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

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

Ответ
 
sleepw

offline
Опыт: 8,449
Активность:
Скил не отображается модель
» вот сам скилл
Код:
//Constants
scope Boomerang
  globals
     private constant integer SpellId='A00W'
     private constant integer DummyId='e001'
     private constant string MissileEffectMdl="Abilities\\Weapons\\ShadowHunterMissile\\ShadowHunterMissile.mdl"
     private constant string DamageEffectMdl="Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl"
     private constant string DamageAttachPoint="chest"
     private constant string MissileAttachPoint="chest"
     private constant real MissileSpeed=15.00
     private constant real PeriodicEvent=0.03
     private constant real Range=90.00
     private constant string Code="Bo_Group"
     private constant string RFunction="Bo_React"
  endglobals

  private constant function Bo_Damage takes integer lvl returns integer
   return (30*lvl)+30    //damage the victim units gets
  endfunction

  private constant function Bo_TurnSpeed takes real ctmp returns real
   return (1.1*ctmp)+2  //Turn Speed of the missiles
  endfunction

  //Conditions

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

  //Actions

  private function Bo_EnumDamage takes nothing returns nothing
   local unit c  =I2U(GetStoredInteger(GC(),Code,"c"))
   local unit a  =GetEnumUnit()
   local unit u  =I2U(GetStoredInteger(GC(),Code,"u"))
   local group g =I2G(GetStoredInteger(GC(),Code,"g"))
   if IsUnitNotImmun(u,a) and not IsUnitInGroup(a,g) then
      call GroupAddUnit(g,a)
      call UnitDamageTarget(c,a,I2R(Bo_Damage(GetUnitAbilityLevel(c,SpellId))),true,false,A  TTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
      call DestroyEffect(AddSpecialEffectTarget(DamageEffectMdl,a,DamageAttachPoint))
   endif
   set c=null
   set a=null
   set u=null
   set g=null
  endfunction

  function Bo_React takes nothing returns nothing
     call StoreBoolean(GC(),HS(tm),"back",true)
  endfunction

  private struct BoomerangDatas
    real dx
    real dy
    real distance
    real angle
    unit caster
    real ctmp
    real dtmp
    unit missile1
    unit missile2
    group rdyg1
    group rdyg2
    effect gfx1
    effect gfx2
  endstruct

  private function BoomerangMotion takes nothing returns nothing
    local timer t             =GetExpiredTimer()
    local BoomerangDatas datas=GetStoredInteger(GC(),HS(t),"datas")
    local real x              =0
    local real y              =0
    local group g

    local boolean back         =GetStoredBoolean(GC(),HS(datas.missile1),"back")

      set g=GetUnitsInRange(Range,GetUnitX(datas.missile1),GetUnitY(datas.missile1),null,t  rue)
      call StoreInteger(GC(),Code,"c",H2I(datas.caster))
      call StoreInteger(GC(),Code,"u",H2I(datas.missile1))
      call StoreInteger(GC(),Code,"g",H2I(datas.rdyg1))
      call ForGroup(g,function Bo_EnumDamage)
      call AB_DestroyGroup(g)
      call FlushStoredMission(GC(),Code)

      set g=GetUnitsInRange(Range,GetUnitX(datas.missile2),GetUnitY(datas.missile2),null,t  rue)
      call StoreInteger(GC(),Code,"c",H2I(datas.caster))
      call StoreInteger(GC(),Code,"u",H2I(datas.missile2))
      call StoreInteger(GC(),Code,"g",H2I(datas.rdyg2))
      call ForGroup(g,function Bo_EnumDamage)
      call AB_DestroyGroup(g)
      call FlushStoredMission(GC(),Code)

    if datas.dtmp<=datas.distance and datas.ctmp<=180 then

      call VUnitPolarXY(datas.missile1,MissileSpeed,datas.angle+25)

      call VUnitPolarXY(datas.missile2,MissileSpeed,datas.angle-25)
      set datas.dtmp=datas.dtmp+MissileSpeed
    elseif datas.ctmp<=180 then
      set datas.ctmp=Bo_TurnSpeed(datas.ctmp)
      call VUnitPolarXY(datas.missile1,MissileSpeed,datas.angle-datas.ctmp)
      call VUnitPolarXY(datas.missile2,MissileSpeed,datas.angle+datas.ctmp)
    elseif datas.ctmp>180 and datas.dtmp>datas.distance then
      call LaunchNormalChaseMissileAtPointEx(datas.caster,datas.missile1,GetUnitX(datas.mis  sile1),GetUnitY(datas.missile1),0,datas.caster,MissileSpeed,0,RFunction)
      call LaunchNormalChaseMissileAtPointEx(datas.caster,datas.missile2,GetUnitX(datas.mis  sile2),GetUnitY(datas.missile2),0,datas.caster,MissileSpeed,0,RFunction)
      set datas.dtmp=0
    endif

    if not back then
    call TimerStart(t,PeriodicEvent,false,function BoomerangMotion)

    elseif back then
      call DestroyEffect(datas.gfx1)
      call DestroyEffect(datas.gfx2)
      call AB_DestroyGroup(datas.rdyg1)
      call AB_DestroyGroup(datas.rdyg2)
      call FlushStoredMission(GC(),HS(datas.missile1))
      call FlushStoredMission(GC(),HS(datas.missile2))
      call RemoveUnit(datas.missile1)
      call RemoveUnit(datas.missile2)
      call FlushStoredMission(GC(),HS(t))
      call BoomerangDatas.destroy(datas)
      call AB_DestroyTimer(t)
    endif 
  endfunction

  private function Trig_Boomerang_Actions takes nothing returns nothing
    local location loc        =GetSpellTargetLoc()
    local timer t             =CreateTimer()
    local BoomerangDatas datas=BoomerangDatas.create()
    local unit u              =GetTriggerUnit()
    local real x              =GetUnitX(u)
    local real y              =GetUnitY(u)
    local real angle          =A2PXY(x,y,GetLocationX(loc),GetLocationY(loc))
    local real distance       =D2PXY(x,y,GetLocationX(loc),GetLocationY(loc))
    local real dx
    local real dy

    local unit missile1       =CreateUnit(GetOwningPlayer(u),DummyId,x,y,angle+15)
    local unit missile2       =CreateUnit(GetOwningPlayer(u),DummyId,x,y,angle-15)

    local effect gfx1         =AddSpecialEffectTarget(MissileEffectMdl,missile1,MissileAttachPoint)
    local effect gfx2         =AddSpecialEffectTarget(MissileEffectMdl,missile2,MissileAttachPoint)
    
    set distance=(distance*75)/100
    set dx=x+distance*Cos(angle*3.14159/180)
    set dy=y+distance*Sin(angle*3.14159/180)

    call SetUnitX(missile1,x)
    call SetUnitY(missile1,y)
    call SetUnitX(missile2,x)
    call SetUnitY(missile2,y)

    call TimerStart(t,0,false,function BoomerangMotion)
    set datas.dx=dx
    set datas.dy=dy
    set datas.distance=distance
    set datas.angle=angle
    set datas.caster=u
    set datas.missile1=missile1
    set datas.missile2=missile2
    set datas.rdyg1=CreateGroup()
    set datas.rdyg2=CreateGroup()
    set datas.gfx1=gfx1
    set datas.gfx2=gfx2
    set datas.ctmp=0
    set datas.dtmp=0
    call StoreInteger(GC(),HS(t),"datas",datas)

    call RemoveLocation(loc)
    set t=null
  endfunction

//===========================================================================
function InitTrig_Boomerang takes nothing returns nothing
    set gg_trg_Boomerang = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Boomerang, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Boomerang, Condition( function Trig_Boomerang_Conditions ) )
    call TriggerAddAction( gg_trg_Boomerang, function Trig_Boomerang_Actions )
endfunction
endscope

почемуто не видно MissileEffectMdl="Abilities\\Weapons\\ShadowHunterMissile\\ShadowHunterMissile.mdl",вообще она присутсвует проверил..
а вот
DamageEffectMdl="Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl"
нормально проигрывается.. что может быть такое?..
Старый 28.12.2007, 17:51
Harakternyk

offline
Опыт: 2,703
Активность:
sleepw, мне кажется, что значение локальных переменных gfx1 и gfx2 приравнены к выражениям, которое нельзя им передавать.

Можно создать и удалить где-то спецэффект, внести его значение в переменную и без задержек сразу же удалить этот спецэффект, но лучше использовать значение стринг напрямую и без локалок - черех функцию AddSpecialEffectTarget (кстати, значение стринг-переменной DamageEffectMdl именно так и используется, и поэтому не глючит )
Старый 28.12.2007, 18:40
sleepw

offline
Опыт: 8,449
Активность:
так не загадка в том что на карте откуда взял оно работает:)

sleepw добавил:
зы. в том предлоге как ты предложил.. можешь изменить и скинуть?:)
ато я в джассе 0 со шрифтом 72 :D
боюсь там шото напаганить)
Старый 28.12.2007, 20:33
Harakternyk

offline
Опыт: 2,703
Активность:
sleepw, выложи карту на хост какой-нибудь - чтоб можно было бы глянуть. Тогда можно будет более точно определить.
Старый 28.12.2007, 20:41
sleepw

offline
Опыт: 8,449
Активность:
вод..

sleepw добавил:
ну так что?)
есть какието идеи?
Прикрепленные файлы
Тип файла: w3x BoomerangXgm.w3x (42.2 Кбайт, 6 просмотров )
Старый 28.12.2007, 22:40
sleepw

offline
Опыт: 8,449
Активность:
зачем вы оставили меня на произвол судьбы?))...
аомогите плиз.( я думаю для знающего тут никаких траблов.. стоит лишь глянуть=\
скил очень нужен.. :(
Старый 29.12.2007, 20:21
sleepw

offline
Опыт: 8,449
Активность:
решил close
Старый 30.12.2007, 17:58
Ответ

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

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

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

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



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