Problemas de diseño de habilidades en el editor de Warcraft
El siguiente es el código de habilidad.
Primero, crea una nueva variable del tipo de caché del juego llamada "gc_jump"
El nombre del activador es "Jump"
Después de terminarlo, encontré que pareció hacerlo. ¡Es Guan Yu saltando hacia Jinsan--!
Pero es más conveniente que él. Señalaba pisos y personas, y algunas personas los perseguían y golpeaban.
La función htoi acepta el identificador h y devuelve un número entero
Devuelve h
Devuelve 0
Finalizar función
Función itou Aceptar entero I y devolver unidad
Devolver I
Devolver nulo
Finalizar función
La función gc no toma ningún valor y devuelve gamecache
p>Si gc_jump==null, entonces
Llame a FlushGameCache(InitGameCache(" nef . w3v "))
set GC_jump = InitGameCache(" nef . w3v " )
endif
Regresar gc_jump
Finalizar función
La función jump_move_i no toma ningún contenido y no devuelve cualquier cosa
Temporizador local tm = GetExpiredTimer()
Unidad local trgunit = itou(GetStoredInteger(GC(), I2S(htoi(tm)), "trgunit"))
buey real local = GetStoredReal(gc(), I2S(htoi(tm)), "ox")
oy real local = GetStoredReal(gc(), I2S(htoi(tm)) , "oy")
tx real local = GetStoredReal(gc(), I2S(htoi(tm)), "tx")
ty real local = GetStoredReal(gc() , I2S(htoi( tm)), "ty")
Paso entero local = GetStoredInteger(gc(), I2S(htoi(tm)), "paso")
Local entero max = GetStoredInteger( gc(), I2S(htoi(tm)), "max")
Si el paso lt entonces max
Llame a SetUnitX(trgunit,ox ((tx- ox)/ I2R(max))*I2R(paso))
Llamar a SetUnitY(trgunit,oy ((ty-oy)/I2R(max))*I2R(paso))
If (Step ltmax/2 1)
Llamar a SetUnitFlyHeight(trgunit, (1200.00/I2R(max))*I2R(step), 9999.99)
Otros
Llame a SetUnitFlyHeight(trgunit, (1200.00/I2R (máximo))*I2R (tamaño de paso máximo), 9999.99)
endif
Establecer tamaño de paso = tamaño de paso 1 p >
Llamar a StoreInteger(gc(), I2S(htoi(tm)), "step", step)
Otros
Llamar al efecto destructor (AddSpecialEffect("ability\ \ Spell\\Humanity\\Thunderstrike\\Thunderstrike.mdl ",tx,ty))
Llamar a UnitDamagePoint(trgunit,0,150.00,tx,ty,100.00 *I2R(GetUnitAbilityLevel(trgunit,' A000 ') , cierto, fa
lse, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
//Llamar a SetPlayerAbilityAvailable(trgunit, 'Amrf', true)
Llamar a UnitRemoveAbility(trgunit, "Amrf")
Llamar a UnitRemoveAbility(trgunit, 'Abun')
Llamar a setunitinvurable(trgunit, false)
Establecer trgunit = null
Llamar a FlushStoredMission(gc(), I2S (htoi(tm)))
Llamar a DestroyTimer(tm)
endif
Finalizar función
La función jump_move_ii no toma ninguna contenido, no devuelve nada
Temporizador local tm = GetExpiredTimer()
Unidad local trgunit = itou(GetStoredInteger(GC(), I2S(htoi(tm)), "trgunit"))
Unidad local tarunit = itou(GetStoredInteger(GC(), I2S(htoi(tm)), "tar unit"))
Paso entero local = GetStoredInteger(gc(), I2S(htoi(tm)), "step")
Entero local max = GetStoredInteger(gc(), I2S(htoi(tm)), "max ")
real local ox = GetUnitX(trgunit)
real local oy = GetUnitY(trgunit)
Número real local tx = GetUnitX(tarunit)
Número real local ty = GetUnitY (tarunit)
Si el paso es lt, entonces Max
Llame a SetUnitX(trgunit, ox (tx-ox)/(I2R (tamaño máximo de paso)))
Llame a SetUnitY(trgunit,oy (ty-oy)/(I2R(max-step)))
Si (paso ltmax/2 1)
Llame a SetUnitFlyHeight(trgunit, ( 1200.00 /I2R(max))*I2R(paso), 9999.99)
Otros
Llamar a SetUnitFlyHeight(trgunit, (1200.00/I2R(max))*I2R(paso máximo) ), 9999.99)
endif
Llamar a SetUnitLookAt(trgunit, "bone_head", tarunit, 0, 0, 90)
Establecer paso = paso 1
Llamar a StoreInteger(gc(), I2S(htoi(tm)), "step", step)
Otros
Efecto destructor de llamadas(AddSpecialEffect( "Ability\\Spell \\Humanity\\Thunderstrike\\Thunderstrike.mdl",tx,ty))
Llamando a UnitDamagePoi
nt(trgunit,0,150.00,tx,ty,100.00 *I2R(GetUnitAbilityLevel(trgunit,' A000 '),true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
//Llamar a SetPlayerAbilityAvailable(trgunit,' Amrf ' , true)
Llamar a UnitRemoveAbility(trgunit, 'Abun')
Llamar a UnitRemoveAbility(trgunit, "Amrf")
Llamar a setunitinvurable(trgunit, false )
Llamar a ResetUnitLookAt(trgunit)
Establecer trgunit = null
establecer tarunit = null
Llamar a FlushStoredMission(gc(), I2S (htoi (tm)))
Llamar a DestroyTimer(tm)
endif
Finalizar función
La función Trig_jump_Actions no realiza ninguna operación, No devuelve ningún contenido
Timertm local
Vaca real local
Compañía inmobiliaria local
Tx real local
bienes raíces locales
unidad local trgunit
unidad local
ubicación local tarloc
set trgunit = GetTriggerUnit()
establecer ox = GetUnitX(trgunit)
establecer oy = GetUnitY(trgunit)
Si GetSpellAbilityId()=='A000 'entonces
establecer tm = CreateTimer()
Si GetUnitAbilityLevel(trgunit, 'Amrf') == 0 entonces
Llame a UnitAddAbility(trgunit, "Amrf")
Llame a SetPlayerAbilityAvailable ( GetTriggerPlayer(), 'Amrf', false)
endif
Si GetSpellTargetUnit()==null, entonces
establece tarloc = GetSpellTargetLoc() p >
Establecer tx = GetLocationX(tarloc)
set ty = GetLocationY(tarloc)
Llamar a StoreInteger(gc(), I2S(htoi(tm)), "trgunit " , htoi(trgunit))
Llamar a StoreReal(gc(), I2S(htoi(tm)), "ox", ox)
Llamar a StoreReal(gc(), I2S ( htoi(tm)), "oy", oy)
Llamar a StoreReal(gc(), i2s(htoi TM), "tx", tx)
Llamar a StoreReal(gc ( ), I2S(htoi(tm)), "ty", ty)
>
Llame a StoreInteger(gc(), I2S(htoi(tm)), "max", R2I((SquareRoot(Pow((tx-ox), 2.00) Pow((ty-oy), 2.00))/ 30.00 1.00)*2.00))
Llamar a StoreInteger(gc(), I2S(htoi(tm)), "step", 0)
Llamar a setunitinvulnable(GetTriggerUnit(), verdadero )
Si GetUnitAbilityLevel(trgunit, 'Abu')==0 entonces
Llame a UnitAddAbility(trgunit, 'Abun')
endif
Llamar a TimerStart(tm, 0.01, TRUE, función jump_move_i)
Otros
set tarunit = GetSpellTargetUnit()
Set tx = GetUnitX(tarunit)
set ty = GetUnitY(tarunit)
Llamar a StoreInteger(gc(), I2S(htoi(tm)), "trgunit", htoi(trgunit))
Llamar a StoreInteger(gc(), I2S(htoi(tm)), "tarunit", htoi(tarunit))
Llamar a StoreInteger(gc(), I2S(htoi(tm)), "max" , R2I((SquareRoot(Pow((tx-ox), 2.00) Pow((ty-oy), 2.00))/30.00 1.00)*2.00))
Llamar a StoreInteger(gc(), I2S (htoi(tm)), "step", 0)
Llamar a setunitinvulnable(trgunit, true)
Si GetUnitAbilityLevel(trgunit, 'Abun')==0 entonces
Llamar a UnitAddAbility(trgunit, 'Abun')
endif
Llamar a TimerStart(tm, 0.01, TRUE, función jump_move_ii)
endif p>
set tm = null
Posición de eliminación de llamada (tarloc)
endif
Finalizar función
//= = ================================================== = =======================
La función InitTrig_jump no toma ningún contenido y no devuelve nada
set gg_trg_jump = CreateTrigger()
Llamar a TriggerRegisterAnyUnitEventBJ(gg_trg_jump, EVENT_PLAYER_UNIT_SPELL_EFFECT)
Llamar a TriggerAddAction(gg_trg_jump, función Trig_jump_Actions)
Finalizar función p >
Pruébalo primero y te daré notas detalladas otro día.
Envíame un correo electrónico y te enviaré los detalles del código.