Change Hero String + Looking for Out of Range system

Status
Not open for further replies.
Level 24
Joined
Nov 9, 2006
Messages
2,561
Ok i got the system here, thats in NvS legends (got the map unprot.).
Its made by chuckles:
JASS:
function Attack_IsOutOfRange takes unit attacked, unit attacker returns boolean
  local string name = GetObjectName(GetUnitTypeId(attacker))
  local real range
  local real dist = SquareRoot((GetUnitX(attacker) - GetUnitX(attacked)) * (GetUnitX(attacker) - GetUnitX(attacked)) + (GetUnitY(attacker) - GetUnitY(attacked)) * (GetUnitY(attacker) - GetUnitY(attacked)))
  set name = SubString(name,4,7)
  set range = S2R(name) * 2
  //call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,10,"Range: "+R2S(range)+"\nDistance: "+R2S(dist))
  return dist > range
endfunction

function Attack_RangeCheck takes nothing returns nothing
  local unit damaged = GetTriggerUnit()
  local unit damager = GetEventDamageSource()
  local real life = GetUnitState(damaged,UNIT_STATE_LIFE)
  
  //Now we find out if the unit is out of range
  if Attack_IsOutOfRange(damaged,damager) and IsUnitType(damager,UNIT_TYPE_MELEE_ATTACKER) then
    call AddAbilityTimed(damaged,'A01Y',1,0)
    call ResetLifeToVal(damaged,life)
    call AddFadingTextTag("missed",GetUnitX(damager),GetUnitY(damager),255,0,0,255)
  endif
  //Boobs - ( . Y . )
  set damaged = null
  set damager = null
endfunction

//===========================================================================
function InitTrig_Out_of_Range_Attacks takes nothing returns nothing
  call GenericDamage_QueueFuncByAttack("Attack_RangeCheck")
endfunction

Heres the errors i get with jass helper (All of em are saying Undeclared function thingy):

call AddAbilityTimed(damaged , 'A01Y' , 1 , 0)
call ResetLifeToVal(damaged , life)
call AddFadingTextTag("missed" , GetUnitX(damager) , GetUnitY(damager) , 255 , 0 , 0 , 255)
call GenericDamage_QueueFuncByAttack("Attack_RangeCheck")

I found out the trigger also requires a spell based of with name "Life Bonus - OutOfRange (Least)" and it has max life gained 10000.
As for other values they are absolutely 0 and the spell is an item.

If you can help me plz keep it simple, im quite noob in jass, but i do know a little at least! :)

Dont ask me about the boob parts btw...
 
Status
Not open for further replies.
Top