Capitán

Barra de Salud : 
Mensajes : 129
Reputación : 28 Monedas de oro : 830 Monedas de Platino : 0 
Inventario :  
 | (#) Tema: Orbe Helada 1.0 Mar Dic 17, 2013 6:26 pm | |
| Recuerdo del primer mensaje :ORBE HELADA por WonderWoman Este es un remake para WC3 de la habilidad homónima de Diablo II de la rama de habilidades de frio de la hechicera. Lanza una orbe helada en la dirección seleccionada y de esta salen rayos de hielo en todas direcciones mientras avanza, al final del recorrido explota en varios rayos a la vez. Cuando un rayo de hielo impacta contra un enemigo de tierra, este es ralentizado y sufre daño. La habilidad tiene 20 niveles y en cada nivel el daño por impacto corresponde al del skill original. - SCREENSHOTS:
-
- CREDITOS:
-
Modelos graficos: Orb of Ice By Frankster SpiritArrow_ByEpsilon By epsilon
- CODIGO:
-
[jass]scope OrbeHelada initializer OnInit
globals //CONSTANTES //Constantes de ID private constant integer ORBE = 'u000' private constant integer SAETA = 'u001' private constant integer NOVA = 'u002' private constant integer NOVASPELL = 'A000' //Constantes de Funcionamiento private constant real AOE = 100.0 private constant real VELOCIDAD_O = 8.0 private constant real VELOCIDAD_S = 14.5 private constant integer MAXCUENTA = 95 private constant real SALTOANGULAR = 85.0 private constant real TIEMPOSAETA = 1.55 private constant integer DELAYSAETA = 5 private constant integer NROSAETAEX = 12 private constant real OFFANG = 43.0 private constant real RADIOFINAL = 160.0 private constant real RADIO = 80.0 private constant string SONIDO = "Abilities\\Spells\\Human\\Blizzard\\BlizzardTarget3.wav" private constant integer SONIDODUR = 3000 //Constantes de Direccionamiento private constant integer JUGADOR = 0 private constant integer ORBEHELADA = 1 private constant integer CONTADOR = 2 private constant integer ANGULO = 3 private constant integer NROSAETAS = 4 private constant integer ORBEEXPLO = 5 private constant integer NIVEL = 6 private constant integer DEFASE = 7 private constant integer SAETA1 = 8 //VARIABLES hashtable OE_hash = InitHashtable() trigger OE_trigger group OE_G = CreateGroup() private hashtable ID_hash = InitHashtable() private unit U_Ret private integer IDS = 0 private integer array IDLIST private boolean OE_enable = false endglobals
private function Modulo takes real a, real b returns real return SquareRoot((a*a)+(b*b)) endfunction
function PreloadSONIDO takes nothing returns nothing local timer tim = GetExpiredTimer() local sound s set s = CreateSound(SONIDO,false,false,true,12700,12700,"") call SetSoundDuration(s, SONIDODUR) call SetSoundVolume(s, 0) call StartSound(s) call KillSoundWhenDone(s) set s = null call PauseTimer(tim) call DestroyTimer(tim) set tim = null endfunction
private function RepSonido takes unit caster returns nothing local sound s = null local integer i = 0 set s = CreateSound(SONIDO,false,false,true,12700,12700,"") call SetSoundDuration(s, SONIDODUR) loop exitwhen i >= 12 if GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then if GetLocalPlayer() == Player(i) then call SetSoundVolume(s, PercentToInt(RMaxBJ(0, 100*(1-0.0004*Modulo(GetUnitX(caster)-GetCameraTargetPositionX(), GetUnitY(caster)-GetCameraTargetPositionY()))), 127)) endif endif set i = i + 1 endloop call StartSound(s) call KillSoundWhenDone(s) set s = null endfunction
private function MUF takes integer jug, integer unicode, real angulo, real x, real y, real FH returns nothing set U_Ret = CreateUnit(Player(jug), unicode, x, y, angulo) call SetUnitPathing(U_Ret, false) call UnitAddAbility(U_Ret, 'Arav') call UnitRemoveAbility(U_Ret, 'Arav') call SetUnitFlyHeight(U_Ret, FH, 0.0) endfunction
private function ObtenerID takes nothing returns integer local integer id = 0 set IDS = IDS + 1 set id = IDLIST[IDS] if id == 0 then set IDLIST[IDS] = IDS set id = IDS endif call SaveInteger(ID_hash, 0, id, IDS) return id endfunction
private function DestruirID takes integer id returns nothing local integer idpos = LoadInteger(ID_hash, 0, id) if idpos != 0 or idpos != null then set IDLIST[idpos] = IDLIST[IDS] call SaveInteger(ID_hash, 0, IDLIST[IDS], idpos) set IDLIST[IDS] = id call SaveInteger(ID_hash, 0, id, 0) set IDS = IDS - 1 endif //------------------------------ if IDS <= 0 then set OE_enable = false call DisableTrigger(OE_trigger) endif endfunction
private function PuntaDeHielo takes unit uSA returns nothing local player p = GetOwningPlayer(uSA) local unit u local unit nov local real x = GetUnitX(uSA) local real y = GetUnitY(uSA) local integer tipoID local boolean checkbool = false call GroupEnumUnitsInRange(OE_G, x, y, AOE, null) loop set u = FirstOfGroup(OE_G) exitwhen u == null or checkbool == true call GroupRemoveUnit(OE_G, u) set tipoID = GetUnitTypeId(u) if IsUnitEnemy(u, p) and GetUnitState(u, UNIT_STATE_LIFE) > 0 and IsUnitIdType(tipoID, UNIT_TYPE_MAGIC_IMMUNE) == false and IsUnitType(u, UNIT_TYPE_FLYING) == false and GetUnitAbilityLevel(u, 'Bvul') == 0 then set nov = CreateUnit(p, NOVA, GetUnitX(u), GetUnitY(u), 0.0) call UnitApplyTimedLife(nov, 'BHwe', 0.50) call UnitAddAbility(nov, NOVASPELL) call SetUnitAbilityLevel(nov, NOVASPELL, GetUnitUserData(uSA)) call IssueTargetOrder(nov, "frostnova", u) call KillUnit(uSA) set checkbool = true endif endloop set u = null set nov = null set p = null endfunction
private function OrbeHelada_T takes nothing returns nothing local integer i = 1 local integer j local integer k local integer jug local integer cont local unit uOE local unit u local real FAnguloR local integer id local integer NroSaetas local real x local real y local real FinalA local integer Nivel local real Defase loop exitwhen i > IDS set id = IDLIST[i] set jug = LoadInteger(OE_hash, id, JUGADOR) set NroSaetas = LoadInteger(OE_hash, id, NROSAETAS) if LoadBoolean(OE_hash, id, ORBEEXPLO) == false then set uOE = LoadUnitHandle(OE_hash, id, ORBEHELADA) set x = GetUnitX(uOE) set y = GetUnitY(uOE) set cont = LoadInteger(OE_hash, id, CONTADOR) set FAnguloR = LoadReal(OE_hash, id, ANGULO) set Nivel = LoadInteger(OE_hash, id, NIVEL) set Defase = LoadReal(OE_hash, id, DEFASE) call SaveInteger(OE_hash, id, CONTADOR, cont-1) if ModuloInteger(cont, DELAYSAETA) == 0 then set FinalA = FAnguloR*bj_RADTODEG+Defase+I2R(cont)*SALTOANGULAR call MUF(jug, SAETA, FinalA+180.0, x+CosBJ(FinalA)*RADIO, y+SinBJ(FinalA)*RADIO, 75.0) call SetUnitUserData(U_Ret, Nivel) call UnitApplyTimedLife(U_Ret, 'BHwe', TIEMPOSAETA) set NroSaetas = NroSaetas + 1 call SaveUnitHandle(OE_hash, id, SAETA1+NroSaetas, U_Ret) endif call SetUnitPosition(uOE, x+Cos(FAnguloR)*VELOCIDAD_O, y+Sin(FAnguloR)*VELOCIDAD_O) if cont <= 1 then call SaveBoolean(OE_hash, id, ORBEEXPLO, true) call KillUnit(uOE) set k = 1 set FinalA = FAnguloR*bj_RADTODEG+ GetRandomReal(0, 360/I2R(NROSAETAEX)) loop exitwhen k > NROSAETAEX set FinalA = FinalA+(360/I2R(NROSAETAEX)) call MUF(jug, SAETA, FinalA+180.0, x+CosBJ(FinalA-OFFANG)*RADIOFINAL, y+SinBJ(FinalA-OFFANG)*RADIOFINAL, 75.0) call SetUnitUserData(U_Ret, Nivel) call UnitApplyTimedLife(U_Ret, 'BHwe', TIEMPOSAETA*0.7) set NroSaetas = NroSaetas + 1 call SaveUnitHandle(OE_hash, id, SAETA1+NroSaetas, U_Ret) set k = k + 1 endloop endif endif set j = 1 loop exitwhen j > NroSaetas set u = LoadUnitHandle(OE_hash, id, SAETA1+j) if GetUnitState(u, UNIT_STATE_LIFE) > 0 then set FAnguloR = (GetUnitFacing(u)+180.0)*bj_DEGTORAD set x = GetUnitX(u) set y = GetUnitY(u) call SetUnitPosition(u, x+Cos(FAnguloR)*VELOCIDAD_S, y+Sin(FAnguloR)*VELOCIDAD_S) call PuntaDeHielo(u) else call SaveUnitHandle(OE_hash, id, SAETA1+j, LoadUnitHandle(OE_hash, id, SAETA1+NroSaetas)) set j = j - 1 set NroSaetas = NroSaetas - 1 endif set j = j + 1 endloop if NroSaetas <= 0 then if LoadBoolean(OE_hash, id, ORBEEXPLO) == true then set i = i - 1 call FlushChildHashtable(OE_hash, id) call DestruirID(id) endif else call SaveInteger(OE_hash, id, NROSAETAS, NroSaetas) endif set i = i + 1 endloop set u = null set uOE = null endfunction
private function OrbeHelada_C takes nothing returns boolean return GetObjectName(GetSpellAbilityId()) == "OrbeHelada" endfunction
private function OrbeHelada_A takes nothing returns nothing local unit u = GetTriggerUnit() local integer jug = GetPlayerId(GetOwningPlayer(u)) local real FAnguloD = GetUnitFacing(u) local real FAnguloR = FAnguloD*bj_DEGTORAD local real x = GetUnitX(u) + Cos(FAnguloR)*55.0 local real y = GetUnitY(u) + Sin(FAnguloR)*55.0 local integer id = ObtenerID() local unit uOE call MUF(jug, ORBE, FAnguloD, x, y, 0.0) set uOE = U_Ret call SaveInteger(OE_hash, id, JUGADOR, jug) call SaveUnitHandle(OE_hash, id, ORBEHELADA, uOE) call SaveInteger(OE_hash, id, CONTADOR, MAXCUENTA) call SaveReal(OE_hash, id, ANGULO, FAnguloR) call SaveInteger(OE_hash, id, NROSAETAS, 0) call SaveInteger(OE_hash, id, NIVEL, GetUnitAbilityLevel(u,GetSpellAbilityId())) call SaveBoolean(OE_hash, id, ORBEEXPLO, false) call SaveReal(OE_hash, id, DEFASE, 0.5*(GetRandomReal(0.0,SALTOANGULAR))) call RepSonido(u) if OE_enable == false then set OE_enable = true call EnableTrigger(OE_trigger) endif set u = null set uOE = null endfunction
private function OnInit takes nothing returns nothing local trigger t = CreateTrigger() local timer tim = CreateTimer() call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT) call TriggerAddCondition(t, Condition(function OrbeHelada_C)) call TriggerAddAction(t, function OrbeHelada_A) set t = null set OE_trigger = CreateTrigger() call TriggerRegisterTimerEvent(OE_trigger, 0.02, true) call TriggerAddAction(OE_trigger, function OrbeHelada_T) call DisableTrigger(OE_trigger) //----------------------------------------- call Preload("war3mapImported\\OrbIceX.mdx") call Preload("war3mapImported\\SpiritArrow_ByEpsilon.mdx") call TimerStart(tim, 0.05, false, function PreloadSONIDO) set tim = null endfunction
endscope[/jass]
- INSTRUCCIONES PARA IMPORTAR:
-
Esta habilidad esta hecha en vJASS. 1) Importa los modelos graficos del gestor de importaciones asegurandote que conserven la misma ruta. 2) Copia las habilidades OrbeHelada y OrbeHeladaNova a tu mapa y anota sus ID 3) Copia las unidades OrbeHelada, OrbeHeladaAux y OrbeHeladaNova a tu mapa y anota sus ID. 4) Cambia los valores de las primeras 4 constantes a los IDs que anotaste de la siguiente manera: - Código:
-
//Constantes de ID private constant integer ORBE = 'ID de unidad OrbeHelada' private constant integer SAETA = 'ID de unidad OrbeHeladaAux' private constant integer NOVA = 'ID de unidad OrbeHeladaNova' private constant integer NOVASPELL = 'ID de skill OrbeHeladaNova'
Para modificar constantes del spell:Puedes modificar los siguientes parámetros bajo tu propio riesgo, te sugiero conservar los valores originales como comentario. - Código:
-
//Constantes de Funcionamiento private constant real AOE = 100.0 private constant real VELOCIDAD_O = 8.0 private constant real VELOCIDAD_S = 14.5 private constant integer MAXCUENTA = 95 private constant real SALTOANGULAR = 85.0 private constant real TIEMPOSAETA = 1.55 private constant integer DELAYSAETA = 5 private constant integer NROSAETAEX = 12 private constant real OFFANG = 43.0 private constant real RADIOFINAL = 160.0 private constant real RADIO = 80.0 private constant string SONIDO = "Abilities\\Spells\\Human\\Blizzard\\BlizzardTarget3.wav" private constant integer SONIDODUR = 3000 También puedes modificar el daño y duración de congelamiento en la habilidad OrbeHeladaNova, y el coste de mana, cooldown y niveles en la habilidad de héroe OrbeHelada.
 and it makes me wonder... |
|