Page 1 of 1

How to change damage?

Posted: November 10th, 2012, 1:24 am
by JustANewbie
the title explained what i want

Spoiler:

Code: Select all

function NT takes unit fG,real Zq,real vQ returns integer
  local timer z=(ch(0))
  local integer kf=og()
  local group g=WG()
  local unit v
  call GroupEnumUnitsInRect(g,bj_mapInitialPlayableArea,null)
  loop
    set v=FirstOfGroup(g)
    exitwhen v==null
    if IsUnitType(v,UNIT_TYPE_STRUCTURE)==false then
      set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(v),'h002',GetUnitX(v),GetUnitY(v),bj_UNIT_FACING)
      call UnitAddAbility(bj_lastCreatedUnit,'A06F')
      call IssueTargetOrderById(bj_lastCreatedUnit,852075,v)
      call UnitApplyTimedLife(bj_lastCreatedUnit,'BTLF',.5)
    endif
    call GroupRemoveUnit(g,v)
  endloop
  call yG(g)
  set IN[kf]=fG
  set dN[kf]=Zq
  set DN[kf]=vQ
  set fN[kf]=WG()
  set CN[kf]=mG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])
  call UnitAddAbility(IN[kf],'Amrf')
  call UnitRemoveAbility(IN[kf],'Amrf')
  call SetUnitFlyHeight(IN[kf],550,0)
  set BN[kf]=MG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])/ 20
  set cN[kf]=32
  set GN[hN[kf]+1]=AddSpecialEffectTarget("war3mapImported\\SolarBlast2.mdx",IN[kf],"hand right")
  set GN[hN[kf]+2]=AddSpecialEffectTarget("war3mapImported\\SolarBlast2.mdx",IN[kf],"hand left")
  call PauseUnit(IN[kf],true)
  call SetUnitInvulnerable(IN[kf],true)
  call SetUnitAnimation(IN[kf],"spell three")
  call TriggerSleepAction(3.5)
  if MG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])<=300 then
    set NN[kf]=CreateUnit(GetOwningPlayer(IN[kf]),'h04N',GetUnitX(IN[kf]),GetUnitY(IN[kf]),CN[kf])
  elseif MG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])<=400 then
    set NN[kf]=CreateUnit(GetOwningPlayer(IN[kf]),'h04R',GetUnitX(IN[kf]),GetUnitY(IN[kf]),CN[kf])
  elseif MG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])<=500 then
    set NN[kf]=CreateUnit(GetOwningPlayer(IN[kf]),'h04K',GetUnitX(IN[kf]),GetUnitY(IN[kf]),CN[kf])
  elseif MG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])<=600 then
    set NN[kf]=CreateUnit(GetOwningPlayer(IN[kf]),'h04Q',GetUnitX(IN[kf]),GetUnitY(IN[kf]),CN[kf])
  elseif MG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])<=700 then
    set NN[kf]=CreateUnit(GetOwningPlayer(IN[kf]),'h04L',GetUnitX(IN[kf]),GetUnitY(IN[kf]),CN[kf])
  elseif MG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])<=800 then
    set NN[kf]=CreateUnit(GetOwningPlayer(IN[kf]),'h04P',GetUnitX(IN[kf]),GetUnitY(IN[kf]),CN[kf])
  elseif MG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])<=900 then
    set NN[kf]=CreateUnit(GetOwningPlayer(IN[kf]),'h04M',GetUnitX(IN[kf]),GetUnitY(IN[kf]),CN[kf])
  elseif MG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])<=1000 then
    set NN[kf]=CreateUnit(GetOwningPlayer(IN[kf]),'h04O',GetUnitX(IN[kf]),GetUnitY(IN[kf]),CN[kf])
  endif
  set AN[kf]=CreateUnit(GetOwningPlayer(IN[kf]),'h002',(((GetUnitX(IN[kf]))*1.)+((200)*1.)*Cos(((CN[kf])*1.)*bj_DEGTORAD)),(((GetUnitY(IN[kf]))*1.)+((200)*1.)*Sin(((CN[kf])*1.)*bj_DEGTORAD)),0)
  call SetUnitFlyHeight(AN[kf],650,0)
  call SetUnitScale(AN[kf],1,1,1)
  call SetUnitTimeScale(IN[kf],0)
  call SaveInteger(J,0,GetHandleId((z)),(kf))
  call TimerStart(z,.02,true,function AT)
  return kf
endfunction

Re: How to change damage?

Posted: November 10th, 2012, 2:38 pm
by Apple
I'm just going to reply according to title. Add a jjcp, type -str/-agi/-int 9999999 and there you go, your damage. ;)

Re: How to change damage?

Posted: November 10th, 2012, 2:51 pm
by JustANewbie
who told you that i wanted to add CP?

Re: How to change damage?

Posted: November 10th, 2012, 3:17 pm
by KangTooJee
call UnitDamageTargetBJ..

Re: How to change damage?

Posted: November 10th, 2012, 4:03 pm
by Fukki
function AT
post this function or *.j file
i can't read this function

Re: How to change damage?

Posted: November 10th, 2012, 4:09 pm
by JustANewbie
i shall post the war3map.j actually i posted at your tool topic but nevermind i upload again

i would like to ask what is the current time at your place?

Re: How to change damage?

Posted: November 10th, 2012, 4:27 pm
by Fukki
follow red color
Spoiler:
function Gh takes unit c,unit t,real r returns nothing
local unit d
local real hh=r
if GetUnitAbilityLevel(t,'A02M')>=1 then
set hh=hh-(hh*(GetUnitAbilityLevel(t,'A02M')*.05))
endif
if GetUnitAbilityLevel(t,'A06O')>=1 then
set hh=hh-(hh*(GetUnitAbilityLevel(t,'A06O')*.05))
endif
set d=CreateUnit(GetOwningPlayer(c),'h02X',GetUnitX(t),GetUnitY(t),bj_UNIT_FACING)
call UnitDamageTarget(d,t,r,true,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_MAGIC,null)
call RemoveUnit(d)
set d=null
endfunction
function Hh takes unit c,unit t,real r returns nothing
local unit d
local real hh=r
if hh>=50 and UnitHasItemOfTypeBJ(t,'I00R') and GetRandomReal(1,100)<=5 then
set d=CreateUnit(GetOwningPlayer(t),'h00F',GetUnitX(c),GetUnitY(c),bj_UNIT_FACING)
call UnitDamageTarget(d,c,hh,true,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_MAGIC,null)
call RemoveUnit(d)
else
if UnitHasItemOfTypeBJ(t,'I028') then
set hh=hh-(hh*.05)
endif
if UnitHasItemOfTypeBJ(t,'I029') then
set hh=hh-(hh*.1)
endif
if UnitHasItemOfTypeBJ(t,'I02A') then
set hh=hh-(hh*.15)
endif
if UnitHasItemOfTypeBJ(t,'I02B') then
set hh=hh-(hh*.2)
endif
if UnitHasItemOfTypeBJ(t,'I02C') then
set hh=hh-(hh*.25)
endif
if GetUnitAbilityLevel(t,'B00D')>=1 then
set hh=hh-(hh*(GetUnitAbilityLevel(t,'A02O')*.05))
endif
if GetUnitAbilityLevel(t,'B006')>=1 then
set hh=hh-(hh*(GetUnitAbilityLevel(t,'A011')*.03))
endif
if GetUnitTypeId(t)=='H02I' then
set hh=hh-(hh*(GetUnitAbilityLevel(t,'A02Z')*.05))
endif
if GetUnitAbilityLevel(t,'B00Z')>=1 then
set hh=0
endif
set d=CreateUnit(GetOwningPlayer(c),'h00F',GetUnitX(t),GetUnitY(t),bj_UNIT_FACING)
call UnitDamageTarget(d,t,hh,true,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_MAGIC,null)
call RemoveUnit(d)
endif
set d=null
endfunction
function jh takes unit c,unit t,real r returns nothing
local unit d
local real hh=r
local texttag tt
if hh>=50 and UnitHasItemOfTypeBJ(t,'I00R') and GetRandomReal(1,100)<=5 then
set d=CreateUnit(GetOwningPlayer(t),'h02W',GetUnitX(c),GetUnitY(c),bj_UNIT_FACING)
call UnitDamageTarget(d,c,hh,true,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_MAGIC,null)
call RemoveUnit(d)
elseif GetUnitAbilityLevel(t,'A067')>=1 and GetRandomReal(1,100)<=5 then
call SetWidgetLife(t,GetWidgetLife(t)+hh)
set tt=CreateTextTag()
call SetTextTagText(tt,I2S(R2I(hh)),.025)
call SetTextTagPos(tt,GetUnitX(t),GetUnitY(t),0)
call SetTextTagColor(tt,100,255,100,255)
call SetTextTagVelocity(tt,0,.07)
call SetTextTagPermanent(tt,false)
call SetTextTagLifespan(tt,1.5)
else
if UnitHasItemOfTypeBJ(t,'I024') then
set hh=hh-(hh*.05)
endif
if UnitHasItemOfTypeBJ(t,'I025') then
set hh=hh-(hh*.1)
endif
if UnitHasItemOfTypeBJ(t,'I026') then
set hh=hh-(hh*.15)
endif
if UnitHasItemOfTypeBJ(t,'I027') then
set hh=hh-(hh*.2)
endif
if UnitHasItemOfTypeBJ(t,'I02C') then
set hh=hh-(hh*.25)
endif
if GetUnitAbilityLevel(t,'A02M')>=1 then
set hh=hh-(hh*(GetUnitAbilityLevel(t,'A02M')*.02))
endif
if GetUnitAbilityLevel(t,'A06O')>=1 then
set hh=hh-(hh*(GetUnitAbilityLevel(t,'A06O')*.02))
endif
if GetUnitAbilityLevel(t,'A067')>=1 then
set hh=hh-(hh*(GetUnitAbilityLevel(t,'A067')*.03))
endif
if GetUnitAbilityLevel(t,'B006')>=1 then
set hh=hh-(hh*(GetUnitAbilityLevel(t,'A011')*.03))
endif
if GetUnitAbilityLevel(t,'B00J')>=1 then
set hh=hh-(hh*(GetUnitAbilityLevel(t,'A02W')*.03))
endif
if GetUnitTypeId(t)=='H02I' then
set hh=hh-(hh*(GetUnitAbilityLevel(t,'A02Z')*.05))
endif
if GetUnitAbilityLevel(t,'B00Z')>=1 then
set hh=0
endif
set d=CreateUnit(GetOwningPlayer(c),'h02W',GetUnitX(t),GetUnitY(t),bj_UNIT_FACING)
call UnitDamageTarget(d,t,hh,true,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_MAGIC,null)
call RemoveUnit(d)
endif
set d=null
set tt=null
endfunction

Re: How to change damage?

Posted: November 11th, 2012, 4:20 am
by JustANewbie
i still don't understand, would you please do it for me? the ability is damage enemy per second for 7 second, 400 damage each second, i wanted to change it to 200+(GetHeroAgi,c,true*2), where c=GetTriggerUnit, i think