Posté le: 16/01/09 20:14 Sujet du message: Problème de jass pour un sort
J'ai un petit problème pour un sort en jass.
Le sort:
Cible une zone; toutes les unités dans la zone sont bloquées par un filet (dummy)
Ensuite des dummys sont crées autour de chaque unité prise dans un filet, et les attaquent.
Quand je lance le sort...Rien ne se passe.
Voilà le code:
Jass:
function Trig_Carver_Sickles_Surrounding_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A06N' ) ) then
return false
endif
return true
endfunction
function en1 takes nothing returns boolean
return ( not ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()) ) == true ) )
endfunction
function Trig_Carver_Sickles_Surrounding_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local location point = GetSpellTargetLoc()
local real angle = 0.00
local real distance = 300
local group g = CreateGroup()
local unit target
local player pl = GetOwningPlayer(u)
local location t_loc
local integer i
local integer j
set g = GetUnitsInRangeOfLocMatching(500, point, Condition(function en1))
A force de bidouiller...Maintenant le sort fonctionne, mais la seule unité attaquée est le héro :s
Ca vient du booléen qui sert de condition à la création du groupe d'unité du sort.
Je finirais par trouver ^^
Jass:
function Trig_Carver_Sickles_Surrounding_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A06N' ) ) then
return false
endif
return true
endfunction
function en1 takes nothing returns boolean
return ( not ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true ) )
endfunction
function Trig_Carver_Sickles_Surrounding_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local location point = GetSpellTargetLoc()
local real angle = 0.00
local real distance = 400
local group g = GetUnitsInRangeOfLocMatching(500, point, Condition(function en1))
local unit target
local player pl = GetOwningPlayer(u)
local location t_loc
local integer i = 0
local integer j = 0
set u = null
call RemoveLocation(point)
set point = null
call DestroyGroup(g)
set g = null
set target = null
set pl = null
call RemoveLocation(t_loc)
set t_loc =null
endfunction
//===========================================================================
function InitTrig_Carver_Sickles_Surrounding takes nothing returns nothing
set gg_trg_Carver_Sickles_Surrounding = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Carver_Sickles_Surrounding, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Carver_Sickles_Surrounding, Condition( function Trig_Carver_Sickles_Surrounding_Conditions ) )
call TriggerAddAction( gg_trg_Carver_Sickles_Surrounding, function Trig_Carver_Sickles_Surrounding_Actions )
endfunction
Résolu, pour ceux que ça intéresse.
C'est fou le nombre différent de fonctions dans le jass :s
Jass:
function Trig_Carver_Sickles_Surrounding_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A06N' ) ) then
return false
endif
return true
endfunction
function Trig_Carver_Sickles_Surrounding_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local location point = GetSpellTargetLoc()
local real angle = 0.00
local real distance = 400
local group g = GetUnitsInRangeOfLocAll(350, point)
local unit target
local player pl = GetOwningPlayer(u)
local location t_loc
local integer i = 0
local integer j = 0
set u = null
call RemoveLocation(point)
set point = null
call DestroyGroup(g)
set g = null
set target = null
set pl = null
call RemoveLocation(t_loc)
set t_loc =null
endfunction
//===========================================================================
function InitTrig_Carver_Sickles_Surrounding takes nothing returns nothing
set gg_trg_Carver_Sickles_Surrounding = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Carver_Sickles_Surrounding, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Carver_Sickles_Surrounding, Condition( function Trig_Carver_Sickles_Surrounding_Conditions ) )
call TriggerAddAction( gg_trg_Carver_Sickles_Surrounding, function Trig_Carver_Sickles_Surrounding_Actions )
endfunction
Page 1 sur 1 La question posée dans ce topic a été résolue !
Vous ne pouvez pas poster de nouveaux sujets dans ce forum Vous ne pouvez pas répondre aux sujets dans ce forum Vous ne pouvez pas éditer vos messages dans ce forum Vous ne pouvez pas supprimer vos messages dans ce forum Vous ne pouvez pas voter dans les sondages de ce forum