XGM Forum
Сайт - Статьи - Проекты - Ресурсы - Блоги

Форуме в режиме ТОЛЬКО ЧТЕНИЕ. Вы можете задать вопросы в Q/A на сайте, либо создать свой проект или ресурс.
Вернуться   XGM Forum > Warcraft> Академия: форум для вопросов> Jass
Ник
Пароль
Войти через VK в один клик
Сайт использует только имя.

Ответ
 
sleepw

offline
Опыт: 8,449
Активность:
Помогите вылечить ошибку при сохранении карты
дайте плиз вотето.. либоя слепой либо там нету этого.
#


Q - Как запретить редактору выключать триггеры в результате ошибок?
A - К сожалению, система защиты от глюков так просто не сдается, можно добавить некоторую строку, например "//" в секцию custom script карты или воспользоваться специальной утилитой, которая лечит это.
Сама утилита прикреплена в это сообщение под именем "vwe".

sleepw добавил:
всё сори нашёл.. но неплохо былобы до удобности поместить ссылку в гайд.. ато я ели додумался=\

sleepw добавил:

хелп


» script
Код:
scope MysticNet
  globals
    private constant integer SpellId='A00S'
    private constant string LightningType="LEAS"
    private constant integer BuffSpellId='A00T'
    private constant string BuffOrder="berserk"
    private rect MaxArea=null
    private constant real MissileFlyHeight=60.00
    private constant real MaxMissileDistance=750.00
    private constant real MissileSpeed=20.00
    private constant real TargetSpeed=15.00
    private constant real Periodic=0.03
    private constant real MissileCollision=90.00
    private constant real StopTargetRange=120.00
    private constant real lightningZ=45.00
    private constant real DeformationRange=200.00
    private constant string Code="MysticNet_SaveCodeString"
    private constant integer DummyId='e000'
    private constant string MissileGFXPath="Abilities\\Weapons\\LordofFlameMissile\\LordofFlameMissile.mdl"
    private constant string MissileGFXAttach="origin"
    private constant string MissGFXPath="Abilities\\Spells\\Orc\\Disenchant\\DisenchantSpecialArt.mdl"
    private constant string MissGFXAttach="origin"
    private constant string HitGFXPath="Abilities\\Spells\\Human\\AerialShackles\\AerialShacklesTarget.mdl"
    private constant string HitGFXAttach="origin"
    private constant string GroundHitGFXPath="Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl"
    private constant string GroundNetGFXPath="Abilities\\Weapons\\DemolisherFireMissile\\DemolisherFireMissile.mdl"
    private constant string ReactHitGFXPath="Abilities\\Spells\\NightElf\\BattleRoar\\RoarCaster.mdl"
    private constant string ReactHitGFXAttach="origin"
    private constant string ReactMissGFXPath="Abilities\\Spells\\NightElf\\Taunt\\TauntCaster.mdl"
    private constant string ReactMissGFXAttach="origin"
    private constant real maxHigh=500.00
  endglobals

  private constant function MaxFlyHeight takes real distance returns real
    return distance*1.1
  endfunction

  private constant function DamagePerLevel takes real lvl returns real
     return 20+60*lvl
  endfunction

  function Trig_Mystic_Net_Conditions takes nothing returns boolean
    return GetSpellAbilityId()==SpellId
  endfunction

  private struct MNdat_Throw
    real x
    real y
    real z
    real ux
    real uy
    real endh
    real temptime
    real distance
    real angle
    unit caster
    unit target
    unit GFXdummy
    effect GFX
    boolean hit
    lightning rope
  endstruct

  private function MysticNet_Hit takes nothing returns nothing
    local timer t             =GetExpiredTimer()
    local MNdat_Throw datas   =GetStoredInteger(GC(),HS(t),"datas")
    local real x              =GetUnitX(datas.target)
    local real y              =GetUnitY(datas.target)
    local real cx
    local real cy
    local real angle
    local real time           =datas.distance/TargetSpeed*Periodic
    local real curv

    if time>=datas.temptime and GetUnitState(datas.caster,UNIT_STATE_LIFE)>0.00 then
         set cx=GetUnitX(datas.caster)
         set cy=GetUnitY(datas.caster)
         set angle=A2PXY(x,y,cx,cy)
         set curv=GetFlyParabelEx(datas.x,datas.y,GetUnitDefaultFlyHeight(datas.target),time,  datas.temptime,datas.endh,TargetSpeed,x,y,datas.ux,datas.uy)
         set datas.temptime=datas.temptime+Periodic
         set x=x+TargetSpeed*Cos(angle*3.14159/180)
         set y=y+TargetSpeed*Sin(angle*3.14159/180)

         call MoveLightningEx(datas.rope,true,cx,cy,MissileFlyHeight+CreateZ(x,y),x,y,curv+lig  htningZ+CreateZ(x,y))
         call SetUnitPosition(datas.target,x,y)
         call BugUse_AddFlyAbility(datas.target)
         call SetUnitFlyHeight(datas.target,curv,0)

         call TimerStart(t,Periodic,false,function MysticNet_Hit)
         set t=null
       else
         call UnitDamageTarget(datas.caster,datas.target,DamagePerLevel(I2R(GetUnitAbilityLeve  l(datas.caster,SpellId))),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPO  N_TYPE_WHOKNOWS)
         call UnitAddAbility(datas.target,BuffSpellId)
         call IssueImmediateOrder(datas.target,BuffOrder)
         call UnitRemoveAbility(datas.target,BuffSpellId)
         call TerrainDeformationRippleXY(1,false,x,y,0,DeformationRange,90,0.5,200)
         call DestroyEffect(AddSpecialEffect(GroundHitGFXPath,x,y))
         call DestroyEffect(AddSpecialEffect(GroundNetGFXPath,x,y))
         call BugUse_AddFlyAbility(datas.target)
         call SetUnitFlyHeight(datas.target,GetUnitDefaultFlyHeight(datas.target),300)
         call DestroyEffect(datas.GFX)
         call DestroyLightning(datas.rope)
         call MNdat_Throw.destroy(datas)
         call FlushStoredMission(GC(),HS(t))
         call AB_DestroyTimer(t)
    endif
  endfunction

  private function MysticNet_Miss takes nothing returns nothing
    local timer t             =GetExpiredTimer()
    local MNdat_Throw datas   =GetStoredInteger(GC(),HS(t),"datas")

    if datas.distance>0 then
        set datas.ux=datas.ux+MissileSpeed*Cos(datas.angle*3.14159/180)
        set datas.uy=datas.uy+MissileSpeed*Sin(datas.angle*3.14159/180)
        set datas.distance=datas.distance-MissileSpeed
        call MoveLightningEx(datas.rope,true,datas.ux,datas.uy,datas.z,datas.x,datas.y,datas.  z)
        call DestroyEffect(datas.GFX)
        set datas.GFX=AddSpecialEffectTarget(MissGFXPath,datas.GFXdummy,MissGFXAttach)

        call TimerStart(t,Periodic,false,function MysticNet_Miss)
        set t=null
       else
        call DestroyEffect(datas.GFX)
        call RemoveUnit(datas.GFXdummy)
        call DestroyLightning(datas.rope)
        call MNdat_Throw.destroy(datas)
        call FlushStoredMission(GC(),HS(t))
        call AB_DestroyTimer(t)
    endif
  endfunction

  private function MysticNet_Collision takes nothing returns nothing
    local MNdat_Throw datas   =GetStoredInteger(GC(),Code,"datas")
    local unit u              =GetEnumUnit()
    if IsUnitNotImmun(datas.caster,u) then
       set datas.target=GetEnumUnit()
       set datas.hit=true
    endif
    set u=null
  endfunction

  private function MysticNet_MissileMotion takes nothing returns nothing
    local timer t             =GetExpiredTimer()
    local MNdat_Throw datas   =GetStoredInteger(GC(),HS(t),"datas")
    local real x              =GetUnitX(datas.caster)
    local real y              =GetUnitY(datas.caster)
    local real angle          =A2PXY(x,y,datas.ux,datas.uy)
    local real z
    local group g

    set datas.x=datas.x+MissileSpeed*Cos(angle*3.14159/180)
    set datas.y=datas.y+MissileSpeed*Sin(angle*3.14159/180)
    set datas.distance=D2PXY(datas.x,datas.y,x,y)
    set z=CreateZ(datas.x,datas.y)
    call MoveLightningEx(datas.rope,true,x,y,datas.z,datas.x,datas.y,datas.z)
    call BugUse_AddFlyAbility(datas.GFXdummy)
    call SetUnitFlyHeight(datas.GFXdummy,datas.z-z,0)
    call SetUnitX(datas.GFXdummy,datas.x)
    call SetUnitY(datas.GFXdummy,datas.y)
    call SetUnitFacing(datas.GFXdummy,angle)

    set g=GetUnitsInRange(MissileCollision,datas.x,datas.y,null,true)
    call StoreInteger(GC(),Code,"datas",datas)
    call ForGroup(g,function MysticNet_Collision)
    call FlushStoredMission(GC(),Code)
    call AB_DestroyGroup(g)

    if z>=datas.z or datas.distance>=MaxMissileDistance or not RectContainsCoords(MaxArea,datas.x,datas.y) or GetUnitState(datas.caster,UNIT_STATE_LIFE)<=0.00 or CountDestructableInRangeOfXY(datas.x,datas.y,MissileCollision)>0 then

         //Miss Init
         call DestroyEffect(datas.GFX)

         set datas.ux=x
         set datas.uy=y
         set datas.angle=A2PXY(x,y,datas.x,datas.y)
         set datas.GFX=AddSpecialEffectTarget(MissGFXPath,datas.GFXdummy,MissGFXAttach)

         call DestroyEffect(AddSpecialEffectTarget(ReactMissGFXPath,datas.caster,ReactMissGFXA  ttach))
         call BugUse_AddFlyAbility(datas.GFXdummy)
         call SetUnitFlyHeight(datas.GFXdummy,datas.z-z,0)
         call SetUnitX(datas.GFXdummy,datas.x)
         call SetUnitY(datas.GFXdummy,datas.y)

         call TimerStart(t,Periodic,false,function MysticNet_Miss)
       else
         if datas.hit then
           //Hit Init
           call RemoveUnit(datas.GFXdummy)
           call DestroyEffect(datas.GFX)

           set datas.temptime=0
           set datas.x=GetUnitX(datas.target)
           set datas.y=GetUnitY(datas.target)
           set datas.ux=x+StopTargetRange*Cos(angle*3.14159/180)
           set datas.uy=y+StopTargetRange*Sin(angle*3.14159/180)
           set datas.distance=D2PXY(datas.x,datas.y,datas.ux,datas.uy)
           set datas.endh=MaxFlyHeight(datas.distance)
           set datas.GFX=AddSpecialEffectTarget(HitGFXPath,datas.target,HitGFXAttach)

           call DestroyEffect(AddSpecialEffectTarget(ReactHitGFXPath,datas.caster,ReactHitGFXAtt  ach))
           call SetUnitPathing(datas.target,false)
           call TimerStart(t,0,false,function MysticNet_Hit)
         else
         //loop
           call TimerStart(t,Periodic,false,function MysticNet_MissileMotion)
         endif
    endif
    set t=null   
  endfunction

  private function Trig_Mystic_Net_Actions takes nothing returns nothing
    local timer t             =CreateTimer()
    local unit caster         =GetTriggerUnit()
    local real x              =GetUnitX(caster)
    local real y              =GetUnitY(caster)
    local location loc        =GetSpellTargetLoc()
    local real lx             =GetLocationX(loc)
    local real ly             =GetLocationY(loc)
    local MNdat_Throw datas   =MNdat_Throw.create()
    local real z              =CreateZ(x,y)
    
    set datas.hit=false
    set datas.x=x
    set datas.y=y
    set datas.ux=lx
    set datas.uy=ly
    set datas.z=MissileFlyHeight+CreateZ(x,y)
    set datas.distance=0
    set datas.caster=caster
    set datas.target=null
    set datas.rope=AddLightningEx(LightningType,true,x,y,datas.z,x,y,datas.z)
    set datas.GFXdummy=CreateUnit(Player(14),DummyId,x,y,A2PXY(x,y,lx,ly))
    set datas.GFX=AddSpecialEffectTarget(MissileGFXPath,datas.GFXdummy,MissileGFXAttach)  
    call BugUse_AddFlyAbility(datas.GFXdummy)
    call SetUnitFlyHeight(datas.GFXdummy,datas.z-z,0)
    call SetUnitX(datas.GFXdummy,x)
    call SetUnitY(datas.GFXdummy,y)

    call TimerStart(t,0,false,function MysticNet_MissileMotion)
    call StoreInteger(GC(),HS(t),"datas",datas)

    call RemoveLocation(loc)
    set t=null  
  endfunction

//===========================================================================
function InitTrig_Mystic_Net_____________________u takes nothing returns nothing
    set gg_trg_Mystic_Net_____________________u = CreateTrigger(  )
    set MaxArea=bj_mapInitialPlayableArea
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Mystic_Net_____________________u, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Mystic_Net_____________________u, Condition( function Trig_Mystic_Net_Conditions ) )
    call TriggerAddAction( gg_trg_Mystic_Net_____________________u, function Trig_Mystic_Net_Actions )
endfunction
endscope

неполучается ничем сохранить:(((((( хотя на мапе откуда взял нормально работает.. хелпхелп
Старый 27.12.2007, 17:27
df Hunter
Нападатель
offline
Опыт: 5,749
Активность:
Старый 27.12.2007, 17:40
sleepw

offline
Опыт: 8,449
Активность:
Цитата:
Сообщение от df Hunter

пацёмал нежно в лобек:)
сенки огромное!)
Старый 27.12.2007, 18:31
Ответ

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы можете скачивать файлы

BB-коды Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход



Часовой пояс GMT +3, время: 06:27.