Inscrit le: 12 Nov 2011 Messages: 1062 Sujets: 107 Spécialité en worldedit: Inactif(Enfin presque) Médailles: 1 (En savoir plus...)
Posté le: 15/03/13 19:16 Sujet du message: Mon C.R.S (GUI/vJass)
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
Evénements
Map initialization
Conditions
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
Evénements
Unité - A unit owned by Neutre Hostile Pourrit
Conditions
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
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Number of units in CR_Respawn_Group) Egal à 1
Alors - Actions
Déclencheur - Turn on Creeps respawn system GUI Loop <gen>
Sinon - Actions
Gui:
Trigger:
Creeps respawn system GUI Loop
Evénements
Temps - Every 0.03 seconds of game time
Conditions
Actions
For each (Integer CR_Count2) from 1 to CR_Count1, do (Actions)
Boucle - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
CR_Respawn_Time[CR_Count2] Supérieur à 0.00
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
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
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(CR_Respawn_Group is empty) Egal à TRUE
Alors - Actions
Set CR_Count1 = 0 Déclencheur - Turn off (This trigger)
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]
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() ) )
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.
Posté le: 15/03/13 19:23 Sujet du message:
Il marche si y a un groupes d'unités neutres, un peu comme les spots de creeps de DotA par exemple ? _________________
Inscrit le: 12 Nov 2011 Messages: 1062 Sujets: 107 Spécialité en worldedit: Inactif(Enfin presque) Médailles: 1 (En savoir plus...)
Posté le: 15/03/13 19:42 Sujet du message:
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é. _________________
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