Worldedit
  Worldedit
Le site sur l'éditeur de warcraft 3 !
 
  FAQFAQ   RechercherRechercher   Liste des MembresListe des Membres    Groupes d'utilisateursGroupes d'utilisateurs   medals.phpMé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

Mon C.R.S (GUI/vJass)

 
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
 Ectelion
Membre reconnu


Inscrit le: 12 Nov 2011
Messages: 1062
Sujets: 107
Spécialité en worldedit: Inactif(Enfin presque)
Médailles: 1 (En savoir plus...)
Créateur d'unité (Quantité : 1)

MessagePosté le: 15/03/13 19:16    Sujet du message: Mon C.R.S (GUI/vJass) Citer

et non, je ne parle pas de nos amis les tabasseurs d'émeutiers, mais de mon

Creeps Respawn System

Comme son nom l'indique, il permet de ressusciter les monstres neutres, il est user/noob-friendly bien qu'il ne soit que peu modifiable.

Comment il marche:
-Vous tuez un monstre
-Une ombre du monstre apparaît et gagne en couleur et "solidité"
-Lorsqu'elle devient complètement solide elle devient attaquable

Bon, j'espère qu'il vous plaira:

GUI:
Secret:

Gui:
Trigger:
Creeps respawn system GUI Config
Collapse Evénements
Map initialization
Conditions
Collapse Actions
-------- the timer before the unit respawns equal to Base_Config + Level_Configxlevel of the unit --------
Set CR_Respawn_Time_Level_Config = 5.00
Set CR_Respawn_Time_Base_Config = 10.00
-------- the effect created when the unit respawn --------
Set CR_Respawn_Effect = AbilitiesSpellsUndeadAnimateDeadAnimateDeadTarget.mdl


Gui:
Trigger:
Creeps respawn system GUI Ondeath
Collapse Evénements
Unité - A unit owned by Neutre Hostile Pourrit
Conditions
Collapse Actions
Set CR_Count1 = (CR_Count1 + 1)
Set CR_Point = (Position of (Decaying unit))
Set CR_Vertex[CR_Count1] = 0.00
Set CR_Transparency[CR_Count1] = 100.00
Set CR_Respawn_Time[CR_Count1] = (CR_Respawn_Time_Base_Config + (CR_Respawn_Time_Level_Config x (Real((Level of (Decaying unit))))))
Set CR_Vertex_Increase[CR_Count1] = ((100.00 / CR_Respawn_Time[CR_Count1]) x 0.03)
Unité - Create 1 (Unit-type of (Decaying unit)) for Neutre Hostile at CR_Point facing (Facing of (Decaying unit)) degrees
Set CR_Unit[CR_Count1] = (Last created unit)
Unité - Remove (Decaying unit) from the game
Groupe unité - Add CR_Unit[CR_Count1] to CR_Respawn_Group
Custom script:   call UnitAddAbility( udg_CR_Unit[udg_CR_Count1], 'Aloc' )
Unité - Pause CR_Unit[CR_Count1]
Animation - Change CR_Unit[CR_Count1]'s animation speed to 0.00% of its original speed
Animation - Change CR_Unit[CR_Count1]'s vertex coloring to (0.00%, 0.00%, 0.00%) with 100.00% transparency
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse Si - Conditions
(Number of units in CR_Respawn_Group) Egal à  1
Collapse Alors - Actions
Déclencheur - Turn on Creeps respawn system GUI Loop <gen>
Collapse Sinon - Actions


Gui:
Trigger:
Creeps respawn system GUI Loop
Collapse Evénements
Temps - Every 0.03 seconds of game time
Conditions
Collapse Actions
Collapse For each (Integer CR_Count2) from 1 to CR_Count1, do (Actions)
Collapse Boucle - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse Si - Conditions
CR_Respawn_Time[CR_Count2] Supérieur à  0.00
Collapse Alors - Actions
Set CR_Respawn_Time[CR_Count2] = (CR_Respawn_Time[CR_Count2] - 0.03)
Set CR_Vertex[CR_Count2] = (CR_Vertex[CR_Count2] + CR_Vertex_Increase[CR_Count2])
Set CR_Transparency[CR_Count2] = (CR_Transparency[CR_Count2] - CR_Vertex_Increase[CR_Count2])
Animation - Change CR_Unit[CR_Count2]'s vertex coloring to (CR_Vertex[CR_Count2]%, CR_Vertex[CR_Count2]%, CR_Vertex[CR_Count2]%) with CR_Transparency[CR_Count2]% transparency
Collapse Sinon - Actions
Groupe unité - Remove CR_Unit[CR_Count2] from CR_Respawn_Group
Set CR_Point = (Position of CR_Unit[CR_Count2])
Effet spécial - Create a special effect at CR_Point using CR_Respawn_Effect
Effet spécial - Destroy (Last created special effect)
Custom script:   call RemoveLocation(udg_CR_Point)
Unité - Replace CR_Unit[CR_Count2] with a (Unit-type of CR_Unit[CR_Count2]) using Le nouveau max. de l'unité life and mana
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse Si - Conditions
(CR_Respawn_Group is empty) Egal à  TRUE
Collapse Alors - Actions
Set CR_Count1 = 0
Déclencheur - Turn off (This trigger)
Collapse Sinon - Actions



vJass:
Secret:

Jass:
scope CRS initializer Initializer

globals

    private constant real Respawntime_Base = 10
    private constant real Respawntime_Level = 5.00
    private constant real Timeout = 0.03
    private constant string Effect = "Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl"
   
    private group Group = CreateGroup()
    private integer Count = 0
    private timer Timer
   
    private real array Colors
    private real array Vertex
    private real array Colors_Increase
    private real array Remainingtime
    private unit array Unit

endglobals
   
    private function Looping takes nothing returns nothing

        local integer c = 1
        local real x
        local real y
        local real angle
        local integer unit_type

            loop
                exitwhen c > Count

                if Remainingtime[c] > 0.00 then

                    set Remainingtime[c] = Remainingtime[c] - Timeout
                    set Colors[c] = Colors[c] + Colors_Increase[c]
                    set Vertex[c] = Vertex[c] - Colors_Increase[c]

                    call SetUnitVertexColorBJ( Unit[c], Colors[c], Colors[c], Colors[c], Vertex[c] )

                else

                    call GroupRemoveUnitSimple( Unit[c], Group )

                    set x = GetUnitX( Unit[c] )
                    set y = GetUnitY( Unit[c] )
                    set angle = GetUnitFacing( Unit[c] )
                    set unit_type = GetUnitTypeId( Unit[c] )
                   
                    call DestroyEffect( AddSpecialEffect( Effect, x , y )
                    call RemoveUnit(Unit[c])
                    call CreateUnit( Player( PLAYER_NEUTRAL_AGGRESSIVE ), unit_type, x, y, angle )

                        if IsUnitGroupEmptyBJ( Group ) == TRUE then

                            set Count = 0

                            call PauseTimer( Timer )

                        endif

                endif
                set c = c + 1
            endloop

    endfunction
   
    private function Dying takes nothing returns nothing
        local real x = GetUnitX( GetDecayingUnit() )
        local real y = GetUnitY( GetDecayingUnit() )
        local integer ut = GetUnitTypeId( GetDecayingUnit() )
        call RemoveUnit( GetDecayingUnit() )
        set Count = Count + 1
        set Unit[Count] = CreateUnit( Player( PLAYER_NEUTRAL_AGGRESSIVE ) , ut, x , y , GetUnitFacing( GetDyingUnit() ) )
           
        call UnitAddAbility( Unit[Count], 'Aloc' )
        call PauseUnit( Unit[Count], true )

        set Colors[Count] = 0.00
        set Vertex[Count] = 100.00
        set Remainingtime[Count] = Respawntime_Base + (Respawntime_Level * (GetUnitLevel( Unit[Count] ) ) )
        set Colors_Increase[Count] = (100 / Remainingtime[Count]) * Timeout
       
        call SetUnitVertexColorBJ( Unit[Count], 0.00, 0.00, 0.00, 100.00 )
        call GroupAddUnitSimple( Unit[Count], Group )

            if CountUnitsInGroup( Group ) == 1 then

                call TimerStart( Timer, Timeout, true, function Looping )

            endif

    endfunction
   
    private function Initializer takes nothing returns nothing

        local trigger Ondeath = CreateTrigger(  )

        set Timer = CreateTimer(  )
       
        call TriggerRegisterPlayerUnitEventSimple( Ondeath, Player(PLAYER_NEUTRAL_AGGRESSIVE) ,EVENT_PLAYER_UNIT_DECAY )
        call TriggerAddAction( Ondeath, function Dying )

    endfunction

endscope



Télécharger la map
_________________
Inactif(Enfn presque)
Revenir en haut
Voir le profil de l'utilisateur Envoyer un message privé
 Vladadamm
Floodozaurus


Inscrit le: 11 Fév 2011
Messages: 2151
Sujets: 114
Spécialité en worldedit: Chasser le Dragon, puis l'exterminer proprement avec une petite cuillère et une poêle.


MessagePosté le: 15/03/13 19:23    Sujet du message: Citer

Il marche si y a un groupes d'unités neutres, un peu comme les spots de creeps de DotA par exemple ?
_________________
Revenir en haut
Voir le profil de l'utilisateur Envoyer un message privé
 Ectelion
Membre reconnu


Inscrit le: 12 Nov 2011
Messages: 1062
Sujets: 107
Spécialité en worldedit: Inactif(Enfin presque)
Médailles: 1 (En savoir plus...)
Créateur d'unité (Quantité : 1)

MessagePosté le: 15/03/13 19:42    Sujet du message: Citer

Non, c'est en creep par creep, il fait pas les groupes, mais je vais regarder pour voir si je peux ajouter cette fonctionnalité si c'est pas trop compliqué.
_________________
Inactif(Enfn presque)
Revenir en haut
Voir le profil de l'utilisateur Envoyer un message privé
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

 
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