Worldedit
  Worldedit
Le site sur l'éditeur de warcraft 3 !
 
  FAQFAQ   RechercherRechercher   Liste des MembresListe des Membres    Groupes d'utilisateursGroupes d'utilisateurs   medals.php?sid=09c2149dbd7ad2fe7f5aff4152cd7076Médailles   S'enregistrerS'enregistrer 
 ProfilProfil   Se connecter pour vérifier ses messages privésSe connecter pour vérifier ses messages privés   ConnexionConnexion 
  FAQFAQ World Editor   UploadUploader une map ou une image    UploadAjouter sa map à l'annuaire   UploadConsulter l'annuaire

Problème de jass pour un sort

 
Poster un nouveau sujet   Répondre au sujet    Worldedit Index du Forum -> Les sorts
Voir le sujet précédent :: Voir le sujet suivant  
Auteur Message
 jk2pach
Invité








MessagePosté le: 16/01/09 20:14    Sujet du message: Problème de jass pour un sort Citer

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 gGetUnitsInRangeOfLocMatching(500, point, Condition(function en1))
   
    loop
        set target = FirstOfGroup(g)
        call GroupRemoveUnit(g, target)
        exitwhen (target == null)
        set t_loc = GetUnitLoc(target)
        call CreateNUnitsAtLoc( 1, udg_Dummy_type[55], pl, t_loc, bj_UNIT_FACING )
        call UnitApplyTimedLifeBJ( 1, 'BTLF', GetLastCreatedUnit() )
        call IssueTargetOrder(GetLastCreatedUnit(), "ensnare", target)
        loop
            set j = j + 1
            exitwhen j > 6
            call CreateNUnitsAtLoc(1, udg_Dummy_type[56], pl, PolarProjectionBJ(t_loc, distance,angle), 0.00)
            call UnitApplyTimedLifeBJ( 1, 'BTLF', GetLastCreatedUnit() )
            call IssueTargetOrder(GetLastCreatedUnit(), "attack", target)
            set angle = angle +I2R(60)
        endloop
        set j = 0
       endloop
   

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


_________________
Revenir en haut
 jk2pach
Invité








MessagePosté le: 17/01/09 02:24    Sujet du message: Citer

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
   
    loop
        set target = FirstOfGroup(g)
        exitwhen (target == null)
        call GroupRemoveUnit(g, target)
        set t_loc = GetUnitLoc(target)
        call CreateNUnitsAtLoc( 1, udg_Dummy_type[55], pl, t_loc, bj_UNIT_FACING )
        call UnitApplyTimedLifeBJ( 1, 'BTLF', GetLastCreatedUnit() )
        call IssueTargetOrder(GetLastCreatedUnit(), "ensnare", target)
        loop
            set j = j + 1
            exitwhen j > 6
            call CreateNUnitsAtLoc(1, udg_Dummy_type[56], pl, PolarProjectionBJ(t_loc, distance,angle), 0.00)
            call UnitApplyTimedLifeBJ( 2, 'BTLF', GetLastCreatedUnit() )
            call IssueTargetOrder(GetLastCreatedUnit(), "attack", target)
            set angle = angle +I2R(60)
        endloop
        set j = 0
    endloop
   
set u = null
call RemoveLocation(point)
set point = null
call DestroyGroup(g)
set g = null
set target = null
set plnull
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


_________________
Revenir en haut
 jk2pach
Invité








MessagePosté le: 17/01/09 02:46    Sujet du message: Citer

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
   
    loop
        set target = FirstOfGroup(g)
        exitwhen (target == null)
        call GroupRemoveUnit(g, target)
        set t_loc = GetUnitLoc(target)
        if ( IsUnitEnemy(target, pl) == true ) then
        call CreateNUnitsAtLoc( 1, udg_Dummy_type[55], pl, t_loc, bj_UNIT_FACING )
        call UnitApplyTimedLifeBJ( 1, 'BTLF', GetLastCreatedUnit() )
        call IssueTargetOrder(GetLastCreatedUnit(), "ensnare", target)
        loop
            set j = j + 1
            exitwhen j > 6
            call CreateNUnitsAtLoc(1, udg_Dummy_type[56], pl, PolarProjectionBJ(t_loc, distance,angle), 0.00)
            call UnitApplyTimedLifeBJ( 2, 'BTLF', GetLastCreatedUnit() )
            call IssueTargetOrder(GetLastCreatedUnit(), "attack", target)
            set angle = angle +I2R(60)
        endloop
        call TriggerSleepAction(0.10)
        call UnitDamageTargetBJ(u, target, ( 100.00 * I2R(GetUnitAbilityLevelSwapped('A06N', u)) ), ATTACK_TYPE_MELEE, DAMAGE_TYPE_NORMAL )
        set j = 0
        else
        endif
    endloop
   
set u = null
call RemoveLocation(point)
set point = null
call DestroyGroup(g)
set g = null
set target = null
set plnull
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


_________________
Revenir en haut
Montrer les messages depuis:   
Poster un nouveau sujet   Répondre au sujet    Worldedit Index du Forum -> Les sorts Toutes les heures sont au format GMT + 1 Heure
Page 1 sur 1
La question posée dans ce topic a été résolue !

 
Sauter vers:  
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


Powered by phpBB © 2001, 2005 phpBB Group
Traduction par : phpBB-fr.com