Je ne pourrais pas rendre mon sort car je n'ai accès a Internet seulement quelques heures par semaines et que je suis relativement occupé ( en vacances ).
Et mon sort bien que finis montre les bugs les plus puissants de l'univers. D'ailleurs assez bizarre : Une unité avec un vampirisme ou juste la valeur % et le rayon d'action est modifié arrive a crée un fatal lors de sa sélection... Enfin sa doit surement venir de ma mauvaise utilisation des hash et de quelques erreurs de ma part.
Si jamais cela intéresse quelqu'un voici la map en question : Télécharger la map _________________
Inscrit le: 21 Avr 2008 Messages: 1607 Sujets: 81 Spécialité en worldedit: Utiliser le travail des autres Médailles: 3 (En savoir plus...)
Posté le: 26/07/12 09:09 Sujet du message:
2-3h pour faire un sort
Même mes sorts pour le concours d'unité avec juste l'éditeur sans déclo m'avaient pris plus de temps. Alors en mode apprentissage du jass... _________________
Inscrit le: 21 Fév 2010 Messages: 1785 Sujets: 22 Spécialité en worldedit: La modestie Médailles: 1 (En savoir plus...)
Posté le: 30/07/12 23:50 Sujet du message:
Voilà mon entrée. J'ai eu du mal à trouver un sort pour ce thème ^^.
Nuage de Sang par Tirlititi[vJASS/MUI]
Secret:
Description du sort :Draine le sang et 10% de la vie des alliés dans une zone pour invoquer un nuage de sang. Le nuage ralentit la vitesse de déplacement et d'attaque des ennemis proches de 20% et leur inflige des dommages sur la durée. Le nuage soigne également les alliés proches lorsqu'il est détruit à hauteur de 20% du total de vie drainée initialement. La zone d'invocation augmente à chaque niveau.
niveau 1 - 15 dommages + 10% du total de vie drainée lors de l'invocation par seconde pendant 12 secondes.
niveau 2 - 20 dommages + 15% du total de vie drainée lors de l'invocation par seconde pendant 16 secondes.
niveau 3 - 25 dommages + 20% du total de vie drainée lors de l'invocation par seconde pendant 20 secondes.
Infos supp :
Le modèle est de moi, l'icône est de CRAZZYRUSSIAN.
private real array BaseDamageOverTime // Base DoT for units affected by the rain
private real array LifeDrainAmount // Percentage of current life drained for summoning
private real array BonusDamageOverTime // Factor of life drained turned into DoT
private real array HealFactor // Factor of life drained occasionaly healed
private real array LifeDrainRadius // Radius of the spell
private real array CloudDuration // Duration of the invocation
endglobals
private function SetupDatas takes nothing returns nothing
// Level 1
set BaseDamageOverTime[1]=15*TIMEOUT // = 15 damage per second
set LifeDrainAmount[1]=0.1 // = 10% of current life drained
set BonusDamageOverTime[1]=0.1*TIMEOUT // = 10% of life drained dealt per second
set HealFactor[1]=0.2
set LifeDrainRadius[1]=150
set CloudDuration[1]=12
// Level 2
set BaseDamageOverTime[2]=20*TIMEOUT
set LifeDrainAmount[2]=0.1
set BonusDamageOverTime[2]=0.15*TIMEOUT
set HealFactor[2]=0.2
set LifeDrainRadius[2]=250
set CloudDuration[2]=16
// Level 3
set BaseDamageOverTime[3]=25*TIMEOUT
set LifeDrainAmount[3]=0.1
set BonusDamageOverTime[3]=0.2*TIMEOUT
set HealFactor[3]=0.2
set LifeDrainRadius[3]=350
set CloudDuration[3]=20
endfunction
// Filter for units affected by the blood drain
private function DrainFilter takes unit target,unit caster,integer lvl returns boolean
return GetOwningPlayer(target)==GetOwningPlayer(caster) and /*
*/ not IsUnitType(target,UNIT_TYPE_DEAD) and /*
*/ not IsUnitType(target,UNIT_TYPE_MECHANICAL) and /*
*/ not IsUnitType(target,UNIT_TYPE_MAGIC_IMMUNE)
endfunction
// Filter for units affected by the heal on cloud's death
private function HealFilter takes unit target,unit cloud,integer lvl returns boolean
return IsUnitAlly(target,GetOwningPlayer(cloud)) and /*
*/ not IsUnitType(target,UNIT_TYPE_DEAD) and /*
*/ not IsUnitType(target,UNIT_TYPE_MECHANICAL)
endfunction
//==========================//
// //
// END OF CONFIGURATION BLOC //
// //
//==========================//
private struct SpellData
unit invoc
integer lvl
real lifedrained
endstruct
globals
private group TmpGroup=CreateGroup()
private real TmpRadius
endglobals
private function SpellLoop takes nothing returns nothing
local SpellData data=GetTimerData(GetExpiredTimer())
local unit target
if IsUnitType(data.invoc,UNIT_TYPE_DEAD) or GetUnitTypeId(data.invoc)==0 then
if GetUnitTypeId(data.invoc)!=0 then
call GroupEnumUnitsInRange(TmpGroup,GetUnitX(data.invoc),GetUnitY(data.invoc),600,null)
loop
set target=FirstOfGroup(TmpGroup)
exitwhen target==null
call GroupRemoveUnit(TmpGroup,target)
if HealFilter(target,data.invoc,data.lvl) and IsUnitInRangeXY(target,GetUnitX(data.invoc),GetUnitY(data.invoc),400) then
call SetWidgetLife(target,GetWidgetLife(target)+data.lifedrained*HealFactor[data.lvl])
call DestroyEffect(AddSpecialEffectTarget(HEAL_SFX,target,"chest"))
endif
endloop
endif
call ReleaseTimer(GetExpiredTimer())
call data.destroy()
else
call GroupEnumUnitsInRange(TmpGroup,GetUnitX(data.invoc),GetUnitY(data.invoc),300,null)
loop
set target=FirstOfGroup(TmpGroup)
exitwhen target==null
call GroupRemoveUnit(TmpGroup,target)
if GetUnitAbilityLevel(target,BUFF_ID)>0 then
call UnitDamageTarget(data.invoc,target,BaseDamageOverTime[data.lvl]+BonusDamageOverTime[data.lvl]*data.lifedrained,true,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
endif
endloop
endif
endfunction
private function SpellCast takes nothing returns nothing
local real x=GetUnitX(GetSpellTargetUnit())
local real y=GetUnitY(GetSpellTargetUnit())
local unit caster=GetTriggerUnit()
local unit invoc=CreateUnit(GetOwningPlayer(caster),CLOUD_ID,x,y,GetUnitFacing(caster))
local unit tmp
local integer lvl=GetUnitAbilityLevel(caster,SPELL_ID)
local SpellData data=SpellData.create()
local timer t=NewTimerEx(data)
set data.invoc=invoc
set data.lvl=lvl
set data.lifedrained=0
call GroupEnumUnitsInRange(TmpGroup,x,y,LifeDrainRadius[lvl]+200,null)
loop
set tmp=FirstOfGroup(TmpGroup)
exitwhen tmp==null
call GroupRemoveUnit(TmpGroup,tmp)
if DrainFilter(tmp,caster,lvl) and IsUnitInRangeXY(tmp,x,y,LifeDrainRadius[lvl]) then
set data.lifedrained=data.lifedrained+LifeDrainAmount[lvl]*GetWidgetLife(tmp)
call SetWidgetLife(tmp,GetWidgetLife(tmp)*(1-LifeDrainAmount[lvl]))
call DestroyEffect(AddSpecialEffectTarget(DRAIN_SFX,tmp,"chest"))
endif
endloop
call UnitApplyTimedLife(invoc,'BTLF',CloudDuration[lvl])
call SetUnitAnimation(invoc,"birth")
call QueueUnitAnimation(invoc,"stand")
call TimerStart(t,TIMEOUT,true,function SpellLoop)
set caster=null
set invoc=null
endfunction
private function SpellCondition takes nothing returns boolean
if GetSpellAbilityId()==SPELL_ID then
call SpellCast()
endif
return false
endfunction
private function init takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function SpellCondition))
call SetupDatas()
endfunction
Inscrit le: 12 Nov 2011 Messages: 1062 Sujets: 107 Spécialité en worldedit: Inactif(Enfin presque) Médailles: 1 (En savoir plus...)
Posté le: 31/07/12 09:29 Sujet du message:
J'ai testé ton sort Tir, j'ai pas regardé le code parce-que c'est du vjass, mais j'ai juste noté un problème: pour moi, il n'y a pas de nuage(enfin pas de modèle graphique)
EDIT: tu ne respecte pas la template. _________________
Inscrit le: 12 Nov 2011 Messages: 1062 Sujets: 107 Spécialité en worldedit: Inactif(Enfin presque) Médailles: 1 (En savoir plus...)
Posté le: 31/07/12 16:10 Sujet du message:
Non uniquement avec ce modèle, je t'explique lorsque je lance le sort, ça fait un effet sur les unités alliés puis plus rien(les dégâts et le heal sont appliquées) _________________
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/08/12 12:02 Sujet du message:
Bon, ça fait 2jours maintenant que le concours s'est terminé.
Que 2 productions ont été rendues, ce qui est bien dommage.
Peste Sanglante par Lord_Demon_X[GUI/MUI?]
Secret:
Description du sort :Le mage sanglant crée une peste de sang dans la zone visée, absorbant la vitesse et les dégâts des ennemis dans la zone, si il y a des héros, ils perdent des stats qui sont ajoutés au héros,lorsque la peste disparaît les stats sont récupérés.
Niveau 1: 2% de vitesse par seconde, dure 8 secondes, 1 stat par seconde, 3 dégâts par seconde.
Niveau 2: 3% de vitesse par seconde, dure 10 secondes, 2 stats par seconde, 4 dégâts par seconde.
Niveau 3: 4% de vitesse par seconde, dure 12 secondes, 3 stats par seconde, 5 dégâts par seconde.
Infos supp :
Le sort nécessite plusieurs compétences supplémentaires (les malus) pour fonctionner et son "script" ne supporte donc pas directement tout les niveaux.
Je met les crédits ici:
-Skin: Blood mage par Dentothor
-Icone: BTN_CR_SS par CRAZYRUSSIAN
Déclencheurs :
Secret:
Gui:
Trigger:
Lauch
Evénements
Unité - A unit Initie l'effet d'une compétence
Conditions
(Ability being cast) Egal à Peste sanglante
Actions
Set Effects_Type = ObjectsSpawnmodelsOrcOrcbloodBattrollBlood.mdl Set Integer_1 = (Integer_1 + 1) Set Caster[Integer_1] = (Casting unit) Set Point_1[Integer_1] = (Target point of ability being cast) Set Timer[Integer_1] = (6.00 + (2.00 x (Real((Level of Peste sanglante for Caster[Integer_1]))))) -------- Les effets spéciaux --------
For each (Integer a) from 1 to 8, do (Actions)
Boucle - Actions
Set Effects_Integer[Integer_1] = (Effects_Integer[Integer_1] + 1) Set Tmp_Point_2 = (Point_1[Integer_1] offset by 90.00 towards (45.00 x (Real(a))) degrees) Effet spécial - Create a special effect at Tmp_Point_2 using Effects_Type Set Effects[Effects_Integer[Integer_1]] = (Last created special effect) Custom script: call RemoveLocation(udg_Tmp_Point_2)
For each (Integer c) from 1 to 32, do (Actions)
Boucle - Actions
Set Effects_Integer[Integer_1] = (Effects_Integer[Integer_1] + 1) Set Tmp_Point_4 = (Point_1[Integer_1] offset by 270.00 towards (11.25 x (Real(c))) degrees) Effet spécial - Create a special effect at Tmp_Point_4 using Effects_Type Set Effects[Effects_Integer[Integer_1]] = (Last created special effect) Custom script: call RemoveLocation(udg_Tmp_Point_4)
-------- Le malus de stats --------
Groupe unité - Pick every unit in (Units within 300.00 of Point_1[Integer_1] matching ((((Matching unit) belongs to an enemy of (Owner of Caster[Integer_1])) Egal à TRUE) and (((Matching unit) is Un héros) Egal à TRUE))) and do (Actions)
Boucle - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Level of Peste sanglante for Caster[Integer_1]) Egal à 1
Alors - Actions
Unité - Add Affaiblissemnt (niveau 1) (héros) to (Picked unit) Set Ability_Heros[Integer_1] = Affaiblissemnt (niveau 1) (héros)
Sinon - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Level of Peste sanglante for Caster[Integer_1]) Egal à 2
Alors - Actions
Unité - Add Affaiblissemnt (niveau 2) (héros) to (Picked unit) Set Ability_Heros[Integer_1] = Affaiblissemnt (niveau 2) (héros)
Sinon - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Level of Peste sanglante for Caster[Integer_1]) Egal à 3
Alors - Actions
Unité - Add Affaiblissemnt (niveau 3) (héros) to (Picked unit) Set Ability_Heros[Integer_1] = Affaiblissemnt (niveau 3) (héros)
Sinon - Actions
Groupe unité - Add (Picked unit) to Heros_Group[Integer_1]
-------- Le malus de vitesse et de dégâts --------
Groupe unité - Pick every unit in (Units within 300.00 of Point_1[Integer_1] matching (((Matching unit) belongs to an enemy of (Owner of Caster[Integer_1])) Egal à TRUE)) and do (Actions)
Boucle - Actions
Groupe unité - Add (Picked unit) to Units_Group[Integer_1]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Level of Peste sanglante for Caster[Integer_1]) Egal à 1
Alors - Actions
Joueur - Désactiver Affaiblissement (niveau 1) (vitesse) for (Owner of (Picked unit)) Joueur - Désactiver Affaiblissement (niveau 1) (dégâts) for (Owner of (Picked unit)) Unité - Add Affaiblissement (niveau 1) (vitesse) to (Picked unit) Unité - Add Affaiblissement (niveau 1) (dégâts) to (Picked unit) Set Ability_Speed[Integer_1] = Affaiblissement (niveau 1) (vitesse) Set Ability_Damage[Integer_1] = Affaiblissement (niveau 1) (dégâts)
Sinon - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Level of Peste sanglante for Caster[Integer_1]) Egal à 2
Alors - Actions
Joueur - Désactiver Affaiblissement (niveau 2) (vitesse) for (Owner of (Picked unit)) Joueur - Désactiver Affaiblissement (niveau 2) (dégâts) for (Owner of (Picked unit)) Unité - Add Affaiblissement (niveau 2) (vitesse) to (Picked unit) Unité - Add Affaiblissement (niveau 2) (dégâts) to (Picked unit) Set Ability_Speed[Integer_1] = Affaiblissement (niveau 2) (vitesse) Set Ability_Damage[Integer_1] = Affaiblissement (niveau 2) (dégâts)
Sinon - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Level of Peste sanglante for Caster[Integer_1]) Egal à 3
Alors - Actions
Joueur - Désactiver Affaiblissement (niveau 3) (vitesse) for (Owner of (Picked unit)) Joueur - Désactiver Affaiblissement (niveau 3) (dégâts) for (Owner of (Picked unit)) Unité - Add Affaiblissement (niveau 3) (vitesse) to (Picked unit) Unité - Add Affaiblissement (niveau 3) (dégâts) to (Picked unit) Set Ability_Speed[Integer_1] = Affaiblissement (niveau 3) (vitesse) Set Ability_Damage[Integer_1] = Affaiblissement (niveau 3) (dégâts)
Sinon - Actions
Secret:
Gui:
Trigger:
Evénements
Temps - Every 1.00 seconds of game time
Conditions
Actions
For each (Integer f) from 1 to Integer_1, do (Actions)
Boucle - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
Timer[f] Supérieur à 0.00
Alors - Actions
Set Timer[f] = (Timer[f] - 1.00) -------- Détruire les effets spéciaux --------
For each (Integer a) from 1 to Effects_Integer[f], do (Actions)
Set Effects_Integer[f] = 0 -------- Les recréer --------
For each (Integer a) from 1 to 8, do (Actions)
Boucle - Actions
Set Effects_Integer[f] = (Effects_Integer[f] + 1) Set Tmp_Point_2 = (Point_1[f] offset by 90.00 towards (45.00 x (Real(a))) degrees) Effet spécial - Create a special effect at Tmp_Point_2 using Effects_Type Set Effects[Effects_Integer[f]] = (Last created special effect) Custom script: call RemoveLocation(udg_Tmp_Point_2)
For each (Integer c) from 1 to 32, do (Actions)
Boucle - Actions
Set Effects_Integer[f] = (Effects_Integer[f] + 1) Set Tmp_Point_4 = (Point_1[f] offset by 270.00 towards (11.25 x (Real(c))) degrees) Effet spécial - Create a special effect at Tmp_Point_4 using Effects_Type Set Effects[Effects_Integer[f]] = (Last created special effect) Custom script: call RemoveLocation(udg_Tmp_Point_4)
-------- retirer des stats/dégâts/vitesse --------
Groupe unité - Pick every unit in Heros_Group[f] and do (Actions)
Boucle - Actions
Unité - Increase level of Ability_Heros[f] for (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
Ability_Heros[f] Egal à Affaiblissemnt (niveau 1) (héros)
Alors - Actions
Héros - Modify Force of Caster[f]: Ajouter (Number of units in Heros_Group[f]) Héros - Modify Agilité of Caster[f]: Ajouter (Number of units in Heros_Group[f]) Héros - Modify Intelligence of Caster[f]: Ajouter (Number of units in Heros_Group[f]) Set Agi_Bonus[f] = (Agi_Bonus[f] + (Number of units in Heros_Group[f])) Set Int_Bonus[f] = (Int_Bonus[f] + (Number of units in Heros_Group[f])) Set Str_Bonus[f] = (Str_Bonus[f] + (Number of units in Heros_Group[f]))
Sinon - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
Ability_Heros[f] Egal à Affaiblissemnt (niveau 2) (héros)
Alors - Actions
Héros - Modify Force of Caster[f]: Ajouter (2 x (Number of units in Heros_Group[f])) Héros - Modify Agilité of Caster[f]: Ajouter (2 x (Number of units in Heros_Group[f])) Héros - Modify Intelligence of Caster[f]: Ajouter (2 x (Number of units in Heros_Group[f])) Set Agi_Bonus[f] = (Agi_Bonus[f] + (2 x (Number of units in Heros_Group[f]))) Set Int_Bonus[f] = (Int_Bonus[f] + (2 x (Number of units in Heros_Group[f]))) Set Str_Bonus[f] = (Str_Bonus[f] + (2 x (Number of units in Heros_Group[f])))
Sinon - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
Ability_Heros[f] Egal à Affaiblissemnt (niveau 3) (héros)
Alors - Actions
Héros - Modify Force of Caster[f]: Ajouter (3 x (Number of units in Heros_Group[f])) Héros - Modify Agilité of Caster[f]: Ajouter (3 x (Number of units in Heros_Group[f])) Héros - Modify Intelligence of Caster[f]: Ajouter (3 x (Number of units in Heros_Group[f])) Set Agi_Bonus[f] = (Agi_Bonus[f] + (3 x (Number of units in Heros_Group[f]))) Set Int_Bonus[f] = (Int_Bonus[f] + (3 x (Number of units in Heros_Group[f]))) Set Str_Bonus[f] = (Str_Bonus[f] + (3 x (Number of units in Heros_Group[f])))
Sinon - Actions
Groupe unité - Pick every unit in Units_Group[f] and do (Actions)
Boucle - Actions
Unité - Increase level of Ability_Damage[f] for (Picked unit) Unité - Increase level of Ability_Speed[f] for (Picked unit)
Sinon - Actions
For each (Integer a) from 1 to Effects_Integer[f], do (Actions)
Groupe unité - Pick every unit in Units_Group[f] and do (Actions)
Boucle - Actions
Unité - Remove Ability_Damage[f] from (Picked unit) Unité - Remove Ability_Heros[f] from (Picked unit) Unité - Remove Ability_Speed[f] from (Picked unit)
Groupe unité - Remove all units of Heros_Group[f] from Heros_Group[f] Groupe unité - Remove all units of Units_Group[f] from Units_Group[f] Héros - Modify Force of Caster[f]: Soustraire Str_Bonus[f] Héros - Modify Agilité of Caster[f]: Soustraire Agi_Bonus[f] Héros - Modify Intelligence of Caster[f]: Soustraire Int_Bonus[f] Set Caster[f] = Pas d'unité Set Agi_Bonus[f] = 0 Set Int_Bonus[f] = 0 Set Str_Bonus[f] = 0 Custom script: call RemoveLocation(udg_Point_1[udg_f]) Set Integer_1 = (Integer_1 - 1)
Description du sort :Draine le sang et 10% de la vie des alliés dans une zone pour invoquer un nuage de sang. Le nuage ralentit la vitesse de déplacement et d'attaque des ennemis proches de 20% et leur inflige des dommages sur la durée. Le nuage soigne également les alliés proches lorsqu'il est détruit à hauteur de 20% du total de vie drainée initialement. La zone d'invocation augmente à chaque niveau.
niveau 1 - 15 dommages + 10% du total de vie drainée lors de l'invocation par seconde pendant 12 secondes.
niveau 2 - 20 dommages + 15% du total de vie drainée lors de l'invocation par seconde pendant 16 secondes.
niveau 3 - 25 dommages + 20% du total de vie drainée lors de l'invocation par seconde pendant 20 secondes.
Infos supp :
Le modèle est de moi, l'icône est de CRAZZYRUSSIAN.
private real array BaseDamageOverTime // Base DoT for units affected by the rain
private real array LifeDrainAmount // Percentage of current life drained for summoning
private real array BonusDamageOverTime // Factor of life drained turned into DoT
private real array HealFactor // Factor of life drained occasionaly healed
private real array LifeDrainRadius // Radius of the spell
private real array CloudDuration // Duration of the invocation
endglobals
private function SetupDatas takes nothing returns nothing
// Level 1
set BaseDamageOverTime[1]=15*TIMEOUT // = 15 damage per second
set LifeDrainAmount[1]=0.1 // = 10% of current life drained
set BonusDamageOverTime[1]=0.1*TIMEOUT // = 10% of life drained dealt per second
set HealFactor[1]=0.2
set LifeDrainRadius[1]=150
set CloudDuration[1]=12
// Level 2
set BaseDamageOverTime[2]=20*TIMEOUT
set LifeDrainAmount[2]=0.1
set BonusDamageOverTime[2]=0.15*TIMEOUT
set HealFactor[2]=0.2
set LifeDrainRadius[2]=250
set CloudDuration[2]=16
// Level 3
set BaseDamageOverTime[3]=25*TIMEOUT
set LifeDrainAmount[3]=0.1
set BonusDamageOverTime[3]=0.2*TIMEOUT
set HealFactor[3]=0.2
set LifeDrainRadius[3]=350
set CloudDuration[3]=20
endfunction
// Filter for units affected by the blood drain
private function DrainFilter takes unit target,unit caster,integer lvl returns boolean
return GetOwningPlayer(target)==GetOwningPlayer(caster) and /*
*/ not IsUnitType(target,UNIT_TYPE_DEAD) and /*
*/ not IsUnitType(target,UNIT_TYPE_MECHANICAL) and /*
*/ not IsUnitType(target,UNIT_TYPE_MAGIC_IMMUNE)
endfunction
// Filter for units affected by the heal on cloud's death
private function HealFilter takes unit target,unit cloud,integer lvl returns boolean
return IsUnitAlly(target,GetOwningPlayer(cloud)) and /*
*/ not IsUnitType(target,UNIT_TYPE_DEAD) and /*
*/ not IsUnitType(target,UNIT_TYPE_MECHANICAL)
endfunction
//==========================//
// //
// END OF CONFIGURATION BLOC //
// //
//==========================//
private struct SpellData
unit invoc
integer lvl
real lifedrained
endstruct
globals
private group TmpGroup=CreateGroup()
private real TmpRadius
endglobals
private function SpellLoop takes nothing returns nothing
local SpellData data=GetTimerData(GetExpiredTimer())
local unit target
if IsUnitType(data.invoc,UNIT_TYPE_DEAD) or GetUnitTypeId(data.invoc)==0 then
if GetUnitTypeId(data.invoc)!=0 then
call GroupEnumUnitsInRange(TmpGroup,GetUnitX(data.invoc),GetUnitY(data.invoc),600,null)
loop
set target=FirstOfGroup(TmpGroup)
exitwhen target==null
call GroupRemoveUnit(TmpGroup,target)
if HealFilter(target,data.invoc,data.lvl) and IsUnitInRangeXY(target,GetUnitX(data.invoc),GetUnitY(data.invoc),400) then
call SetWidgetLife(target,GetWidgetLife(target)+data.lifedrained*HealFactor[data.lvl])
call DestroyEffect(AddSpecialEffectTarget(HEAL_SFX,target,"chest"))
endif
endloop
endif
call ReleaseTimer(GetExpiredTimer())
call data.destroy()
else
call GroupEnumUnitsInRange(TmpGroup,GetUnitX(data.invoc),GetUnitY(data.invoc),300,null)
loop
set target=FirstOfGroup(TmpGroup)
exitwhen target==null
call GroupRemoveUnit(TmpGroup,target)
if GetUnitAbilityLevel(target,BUFF_ID)>0 then
call UnitDamageTarget(data.invoc,target,BaseDamageOverTime[data.lvl]+BonusDamageOverTime[data.lvl]*data.lifedrained,true,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
endif
endloop
endif
endfunction
private function SpellCast takes nothing returns nothing
local real x=GetUnitX(GetSpellTargetUnit())
local real y=GetUnitY(GetSpellTargetUnit())
local unit caster=GetTriggerUnit()
local unit invoc=CreateUnit(GetOwningPlayer(caster),CLOUD_ID,x,y,GetUnitFacing(caster))
local unit tmp
local integer lvl=GetUnitAbilityLevel(caster,SPELL_ID)
local SpellData data=SpellData.create()
local timer t=NewTimerEx(data)
set data.invoc=invoc
set data.lvl=lvl
set data.lifedrained=0
call GroupEnumUnitsInRange(TmpGroup,x,y,LifeDrainRadius[lvl]+200,null)
loop
set tmp=FirstOfGroup(TmpGroup)
exitwhen tmp==null
call GroupRemoveUnit(TmpGroup,tmp)
if DrainFilter(tmp,caster,lvl) and IsUnitInRangeXY(tmp,x,y,LifeDrainRadius[lvl]) then
set data.lifedrained=data.lifedrained+LifeDrainAmount[lvl]*GetWidgetLife(tmp)
call SetWidgetLife(tmp,GetWidgetLife(tmp)*(1-LifeDrainAmount[lvl]))
call DestroyEffect(AddSpecialEffectTarget(DRAIN_SFX,tmp,"chest"))
endif
endloop
call UnitApplyTimedLife(invoc,'BTLF',CloudDuration[lvl])
call SetUnitAnimation(invoc,"birth")
call QueueUnitAnimation(invoc,"stand")
call TimerStart(t,TIMEOUT,true,function SpellLoop)
set caster=null
set invoc=null
endfunction
private function SpellCondition takes nothing returns boolean
if GetSpellAbilityId()==SPELL_ID then
call SpellCast()
endif
return false
endfunction
private function init takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function SpellCondition))
call SetupDatas()
endfunction
Inscrit le: 23 Aoû 2007 Messages: 7143 Sujets: 147 Spécialité en worldedit: le troll, le flood, la vulgarité, mon coeur balance Médailles: 2 (En savoir plus...)
Posté le: 02/09/12 23:20 Sujet du message:
J'ai lu le code de Tirlititi et je ne vois pas de vérification si une unité est ennemie du caster ou non?
J'ai peut être mal lu mais à priori la description des effets du spell ne serait pas valide ? _________________
Toutes les heures sont au format GMT + 1 Heure Aller à la page Précédente1, 2, 3, 4Suivante
Page 3 sur 4
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