Topic Post Spell

Thảo luận trong 'World Editor' bắt đầu bởi ducthai, 12/5/09.

Trạng thái chủ đề:
Không mở trả lời sau này.
  1. huykho192

    huykho192 The Warrior of Light

    Tham gia ngày:
    9/8/08
    Bài viết:
    2,374
    mọi người sem giúp sao cái spell này, trong máy nhà mình bản 1.21 thì dùng bình thường save map bình thường ko báo lỗi, nhưng khi ra ngoài quán nét bản 1.24 thì báo lỗi ầm ầm ko vào được cả map, phải vào WE tắt cái spell này đi thì mới vô được:((:((
    Mã:
    
    
    
    //**************************************
    //**************************************
    //
    //            Stone Wall
    //               1.4
    //
    // Made for the Spell Making Session 04
    //        at wc3campaigns.net
    //
    //     By: Nicholas Fraser (Vuen)
    //       [email protected]
    //
    // This spell follows the JESP standard.
    //
    //**************************************
    //**************************************
    
    
    
    
    
    //===========================================================================
    //===========================================================================
    //===========================================================================
    //                              CONFIGURATION
    //===========================================================================
    //===========================================================================
    //===========================================================================
    
    
    
    //*********************
    //     REFERENCES
    //*********************
    
    function StoneWall_GameCache takes nothing returns gamecache
            //if your map already has a gamecache,
            //uncomment this line and put the appropriate variable:
        //return udg_GameCache
            //otherwise, leave this function as is.
    
        if bj_lastCreatedGameCache == null then
            set bj_lastCreatedGameCache = InitGameCache("StoneWall.w3v")
        endif
        return bj_lastCreatedGameCache
    endfunction
    
      //The rawcode for the Stone Wall ability
    constant function StoneWall_SpellAbility takes nothing returns integer
        return 'A020'
    endfunction
    
    
    
    //*********************
    //        STATS
    //*********************
    
      //Length of wall
    function StoneWall_Length takes integer level returns real
        return 1024.0 + 170.66 * level
    endfunction
    
      //Whether the wall blocks flying units
    function StoneWall_BlocksAir takes integer level returns boolean
        return false
    endfunction
    
      //Whether the wall blocks visibility
    function StoneWall_BlocksVisibility takes integer level returns boolean
        return true
    endfunction
    
      //Whether the spell is channeled (to turn off channeling
      // you will also need to set the Follow Through Time
      // on the ability to 1.)
    function StoneWall_IsChannel takes integer level returns boolean
        return true
    endfunction
    
      //Duration of wall (ignored if spell is channeled;
      // channeling duration is set on the ability under
      // Follow Through Time.)
    function StoneWall_Duration takes integer level returns real
        return 5.0 * level
    endfunction
    
    
    
    //*********************
    //       EFFECTS
    //*********************
    
      //Change this to change the height of the wall
      //Note that this is not the actual height of the wall, it
      // is a constant used in setting the height
    function StoneWall_PeakHeightStep takes integer level returns real
        return 30.0
    endfunction
    
      //The ground texture applied to the wall
    function StoneWall_UberSplat takes location loc, integer level returns string
        return "OMED" //Orc Medium
    
          //Try this for an undead "Black Wall":
          //  "ULAR" //Undead Large
    endfunction
    
      //Make sure you use double backslashes, \\, instead of single
      // backslashes, \, for the paths:
    
      //Used along the base of the wall
    function StoneWall_BaseEffect takes integer level returns string
        return "war3mapImported\\CloudOfDust.mdx"
    
          //The original cloud of fog; use this for cyan dust instead:
          //"Abilities\\Spells\\Human\\CloudOfFog\\CloudOfFog.mdl"
    endfunction
    
      //The sound played when the wall is raised
    function StoneWall_SoundRaise takes nothing returns string
        return "Abilities\\Spells\\Orc\\EarthQuake\\EarthquakeRock.wav"
    endfunction
    
      //The sound played when the wall is lowered
    function StoneWall_SoundLower takes nothing returns string
        return "Abilities\\Spells\\NightElf\\Barkskin\\BarkSkinTarget1.wav"
    endfunction
    
    
    
    //*********************
    //       TWEAKS
    //*********************
    
      //For all practical purposes these values do not need to be
      // changed.
    
      //Sets the spacing of the peaks, where effects and blockers
      // are placed. If this is set too high, the wall will have
      // gaps in it!
    function StoneWall_PeakSpacing takes integer level returns real
        return 50.0
    endfunction
    
      //The radius of the terrain deformation on each peak.
    function StoneWall_PeakRadius takes integer level returns real
        return 175.0
    endfunction
    
      //The randomness to apply to the location of the terrain deformations.
    function StoneWall_PeakRandomness takes integer level returns real
        return 45.0
    endfunction
    
      //The amount of peaks from each cloud and splat to the next
    function StoneWall_PeakEffectSpacing takes integer level returns integer
        return GetRandomInt(4,6)
    endfunction
    
    
    
    
    
    
    
    
    
    
    
    
    //This is the end of the configuration options. Only
    // modify code beyond this point if you know what you
    // are doing!
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    //===========================================================================
    //===========================================================================
    //===========================================================================
    //                                  CODE
    //===========================================================================
    //===========================================================================
    //===========================================================================
    
    
      //Global utility functions
    
    function StoneWall_H2I takes handle h returns integer
        return h
        return 0
    endfunction
    
    function StoneWall_GlobalTimer takes nothing returns timer
        return GetStoredInteger(StoneWall_GameCache(), "StoneWall", "GlobalTimer")
        return null
    endfunction
    
    function StoneWall_GetPathingBlockerType takes integer level returns integer
        if StoneWall_BlocksAir(level) then
            return 'YTfc' //large both
        endif
        return 'YTpc' //large ground
    endfunction
    
    function StoneWall_GetSightBlockerType takes integer level returns integer
        return 'Ytlc' //large
    endfunction
    
    
      //Variables attached to timers
    
    function StoneWall_GetLocation takes string tref, integer i returns location
        return GetStoredInteger(StoneWall_GameCache(), tref, "Location" + I2S(i))
        return null
    endfunction
    
    function StoneWall_GetPathingBlocker takes string tref, integer i returns destructable
        return GetStoredInteger(StoneWall_GameCache(), tref, "PathingBlocker" + I2S(i))
        return null
    endfunction
    
    function StoneWall_GetSightBlocker takes string tref, integer i returns destructable
        return GetStoredInteger(StoneWall_GameCache(), tref, "SightBlocker" + I2S(i))
        return null
    endfunction
    
    function StoneWall_GetSplat takes string tref, integer i returns ubersplat
        return GetStoredInteger(StoneWall_GameCache(), tref, "Splat" + I2S(i))
        return null
    endfunction
    
    function StoneWall_GetEffect takes string tref, string str, integer i returns effect
        return GetStoredInteger(StoneWall_GameCache(), tref, str + I2S(i))
        return null
    endfunction
    
    function StoneWall_GetDeform takes string tref, integer actionnum, integer i returns terraindeformation
        return GetStoredInteger(StoneWall_GameCache(), tref, "Crater" + I2S(actionnum) + "_" + I2S(i))
        return null
    endfunction
    
    function StoneWall_GetRect takes string tref returns rect
        return GetStoredInteger(StoneWall_GameCache(), tref, "Rect")
        return null
    endfunction
    
    function StoneWall_GetCaster takes string tref returns unit
        return GetStoredInteger(StoneWall_GameCache(), tref, "Caster")
        return null
    endfunction
    
    
    
    
    
      //A wall timer elapsed. (This happens every 0.1 seconds for each wall.)
    
    function StoneWall_TimerElapsed takes nothing returns nothing
        local timer t
        local string tref
        local unit caster
        local location loc
        local boolean stop = false
        local integer i
        local integer iend
        local integer level
        local integer action
        local integer actionnum
        local sound snd
    
    
        set t = GetExpiredTimer()
        set tref = I2S(StoneWall_H2I(t))
        set caster = StoneWall_GetCaster(tref)
        set level = GetStoredInteger(StoneWall_GameCache(), tref, "Level")
        set action = GetStoredInteger(StoneWall_GameCache(), tref, "Action")
        set actionnum = GetStoredInteger(StoneWall_GameCache(), tref, "ActionNum")
    
    
        if action == 1 then //Rising
            set i = GetStoredInteger(StoneWall_GameCache(), tref, "Start")
            set iend = GetStoredInteger(StoneWall_GameCache(), tref, "End")
            loop
                exitwhen i >= iend
                set loc = StoneWall_GetLocation(tref,i)
                call StoreInteger( StoneWall_GameCache(), tref, "Crater" + I2S(actionnum) + "_" + I2S(i), StoneWall_H2I(TerrainDeformCrater( GetLocationX(loc), GetLocationY(loc), StoneWall_PeakRadius(level), -StoneWall_PeakHeightStep(level)/(actionnum+1), 90, true)) )
                set i = i + 1
            endloop
    
            set actionnum = actionnum + 1
            if actionnum > 10 then
                set action = 2
                set actionnum = 0
            endif
    
    
        elseif action == 2 then //Standing
    
            set actionnum = actionnum + 1
    
            if actionnum < 5 then
                //make sure the wall stands for a little while to let terrain deforms finish
            elseif StoneWall_IsChannel(level) then
                if caster == null then  //channeling caster was abnormally removed - end wall and flush caster data
                    set stop = true
                    call FlushStoredMission(StoneWall_GameCache(), "StoneWall" + I2S(GetStoredInteger(StoneWall_GameCache(), tref, "Caster")))
                elseif GetStoredBoolean(StoneWall_GameCache(), tref, "Stop") then
                    set stop = true
                endif
            elseif TimerGetElapsed(StoneWall_GlobalTimer()) > StoneWall_Duration(level) + GetStoredReal(StoneWall_GameCache(), tref, "Time") then //out of time
                set stop = true
            endif
    
            if stop then
                set i = GetStoredInteger(StoneWall_GameCache(), tref, "Start")
                set iend = GetStoredInteger(StoneWall_GameCache(), tref, "End")
                loop
                    exitwhen i >= iend
                    set loc = StoneWall_GetLocation(tref,i)
    
                    call RemoveDestructable( StoneWall_GetPathingBlocker(tref,i) )
                    if StoneWall_BlocksVisibility(level) then
                        call RemoveDestructable( StoneWall_GetSightBlocker(tref,i) )
                    endif
                    call DestroyEffect( StoneWall_GetEffect(tref,"Cloud",i) )
    
                    set actionnum = 0
                    loop
                        call TerrainDeformStop(StoneWall_GetDeform(tref, actionnum, i), 0)
                        set actionnum = actionnum + 1
                        exitwhen actionnum > 10
                    endloop
    
                    set i = i + 1
                endloop
    
                set loc = StoneWall_GetLocation(tref,0)
                set snd = CreateSound( StoneWall_SoundLower(), false, true, true, 10, 10, "SpellsEAX" )
                call SetSoundPosition( snd, GetLocationX(loc), GetLocationY(loc), 0)
                call SetSoundVolume(snd, 95)
                call SetSoundDistanceCutoff(snd, 2500)
                call StartSound(snd)
                call KillSoundWhenDone(snd)
                set snd = null
    
                set action = 3
                set actionnum = 0
            endif
    
        elseif action == 3 then //Falling
            set i = GetStoredInteger(StoneWall_GameCache(), tref, "Start")
            set iend = GetStoredInteger(StoneWall_GameCache(), tref, "End")
            loop
                exitwhen i >= iend
                set loc = StoneWall_GetLocation(tref,i)
                call StoreInteger( StoneWall_GameCache(), tref, "Crater" + I2S(actionnum) + "_" + I2S(i), StoneWall_H2I(TerrainDeformCrater( GetLocationX(loc), GetLocationY(loc), StoneWall_PeakRadius(level), StoneWall_PeakHeightStep(level)/(actionnum+1), 90, true)) )
                if actionnum == 0 then
                    //this is done here instead of the stop action to synchronize it with the terrain drop
                    call DestroyUbersplat( StoneWall_GetSplat(tref,i) )
                endif
                set i = i + 1
            endloop
    
            set actionnum = actionnum + 1
            //For some odd reason, hills do not deform as much as craters. Blame Blizzard.
            if actionnum > 8 then
                set action = 4
                set actionnum = 0
            endif
    
        elseif action == 4 then
    
            set actionnum = actionnum + 1
    
            if actionnum < 5 then
                //make sure the wall stands for a little while to let terrain deforms finish
            else
                //Wall is completely done; flush everything.
    
                set i = GetStoredInteger(StoneWall_GameCache(), tref, "Start")
                set iend = GetStoredInteger(StoneWall_GameCache(), tref, "End")
                loop
                    exitwhen i >= iend
                    set loc = StoneWall_GetLocation(tref,i)
                    call RemoveLocation(loc)
                    set actionnum = 0
                    loop
                        call TerrainDeformStop(StoneWall_GetDeform(tref, actionnum, i), 0)
                        set actionnum = actionnum + 1
                        exitwhen actionnum > 10
                    endloop
                    set i = i + 1
                endloop
    
                call DestroyTimer(t)
                call FlushStoredMission(StoneWall_GameCache(), tref)
    
                //set t = null
                set tref = null
                set snd = null
                set caster = null
                set loc = null
                return
            endif
        endif
    
        call StoreInteger( StoneWall_GameCache(), tref, "Action", action )
        call StoreInteger( StoneWall_GameCache(), tref, "ActionNum", actionnum )
    
        //set t = null
        set tref = null
        set snd = null
        set caster = null
        set loc = null
    endfunction
    
    
    
    
    
      //A unit cast Stone Wall.
    
    function StoneWall_SpellCast takes nothing returns nothing
        local integer level
        local real angle
        local unit caster
        local timer t
        local string tref
        local location source
        local location target
        local location loc
        local location locrandom
        local integer i
        local integer e = 0
        local ubersplat splat
        local sound snd
        local rect bounds
    
        if not(GetSpellAbilityId() == StoneWall_SpellAbility()) then
            return
        endif
    
        set caster = GetSpellAbilityUnit()
        set level = GetUnitAbilityLevelSwapped(StoneWall_SpellAbility(), caster)
    
        set source = GetUnitLoc(caster)
        set target = GetSpellTargetLoc()
        set angle = AngleBetweenPoints(source, target) + 90
    
        set bounds = GetWorldBounds()
    
    
          //Create our timer. All variables related to the wall
          // will be attached to it.
        set t = CreateTimer()
        set tref = I2S(StoneWall_H2I(t))
        call TimerStart(t, 0.1, true, function StoneWall_TimerElapsed)
    
    
    
          //Here we create the wall by projecting and storing
          // the location of each peak, and creating a pathing
          // blocker at each peak.
    
        set i = -R2I(StoneWall_Length(level) / 2 / StoneWall_PeakSpacing(level))
        //store lowest integer (to start looping)
        call StoreInteger( StoneWall_GameCache(), tref, "Start", i )
    
    
        loop
            exitwhen StoneWall_PeakSpacing(level) * i * 2 > StoneWall_Length(level)
    
            //Here we have two locations. The 'loc's lie in a perfect straight line
            // to lay out the pathing blockers, ensuring no holes. The 'locrandom's
            // are randomly shifted about to make the deformation appear more natural.
            set loc = PolarProjectionBJ(target, StoneWall_PeakSpacing(level) * i, angle)
            set locrandom = Location(GetLocationX(loc) + GetRandomReal(-StoneWall_PeakRandomness(level), StoneWall_PeakRandomness(level)), GetLocationY(loc) + GetRandomReal(-StoneWall_PeakRandomness(level), StoneWall_PeakRandomness(level)))
    
            //check if loc and locrandom are on the map
            if RectContainsLoc(bounds, loc) and RectContainsLoc(GetWorldBounds(), locrandom) then
    
                //store the 'locrandom's for deformation
                call StoreInteger( StoneWall_GameCache(), tref, "Location" + I2S(i), StoneWall_H2I(locrandom) )
    
                //create pathing blockers along the 'loc's
                call StoreInteger( StoneWall_GameCache(), tref, "PathingBlocker" + I2S(i), StoneWall_H2I(CreateDestructableLoc( StoneWall_GetPathingBlockerType(level), loc, GetRandomDirectionDeg(), 1, 0 )) )
                if StoneWall_BlocksVisibility(level) then
                    call StoreInteger( StoneWall_GameCache(), tref, "SightBlocker" + I2S(i), StoneWall_H2I(CreateDestructableLoc( StoneWall_GetSightBlockerType(level), loc, GetRandomDirectionDeg(), 1, 0 )) )
                endif
    
                //create splat, effect and sound along the 'locrandom's
                set splat = CreateUbersplat(GetLocationX(locrandom), GetLocationY(locrandom), StoneWall_UberSplat(locrandom,level), 255, 255, 255, 255, false, false)
                call StoreInteger( StoneWall_GameCache(), tref, "Splat" + I2S(i), StoneWall_H2I(splat) )
                if e == 0 then
                    call StoreInteger( StoneWall_GameCache(), tref, "Cloud" + I2S(i), StoneWall_H2I(AddSpecialEffectLoc( StoneWall_BaseEffect(level), locrandom )) )
                    call SetUbersplatRenderAlways( splat, true )
    
                    set snd = CreateSound( StoneWall_SoundRaise(), false, true, true, 10, 10, "SpellsEAX" )
                    call SetSoundPosition( snd, GetLocationX(locrandom), GetLocationY(locrandom), 0)
                    call SetSoundVolume(snd, 127)
                    call SetSoundDistanceCutoff(snd, 2500)
                    call StartSound(snd)
                    call KillSoundWhenDone(snd)
    
                    set e = StoneWall_PeakEffectSpacing(level)
                else
                    //yes, i realize i'm creating unnecessary splats, but they need to be created
                    // otherwise it doesn't work. no splats leak, so it's not a problem.
                    call SetUbersplatRenderAlways( splat, false )
                endif
    
                set e = e - 1
    
            endif
    
            call RemoveLocation(loc) //since it's no longer needed
    
            set i = i + 1
        endloop
    
        call StoreInteger( StoneWall_GameCache(), tref, "Caster", StoneWall_H2I(caster) )
        if StoneWall_IsChannel(level) then
            call StoreInteger( StoneWall_GameCache(), "StoneWall" + I2S(StoneWall_H2I(caster)), "Timer", StoneWall_H2I(t) )
        endif
    
        call StoreInteger( StoneWall_GameCache(), tref, "End", i )
        call StoreInteger( StoneWall_GameCache(), tref, "Level", level )
        call StoreInteger( StoneWall_GameCache(), tref, "Action", 1 )
        call StoreInteger( StoneWall_GameCache(), tref, "ActionNum", 0 )
        call StoreReal   ( StoneWall_GameCache(), tref, "Time", TimerGetElapsed(StoneWall_GlobalTimer()) )
    
    
        call RemoveRect(bounds)
    
        set bounds = null
        set caster = null
        //set t = null
        set tref = null
        call RemoveLocation(source)
        call RemoveLocation(target)
        set source = null
        set target = null
        set loc = null
        set locrandom = null
        set splat = null
        set snd = null
    endfunction
    
    
    
    
    
      //A unit stopped channeling.
    
    function StoneWall_SpellEnd takes nothing returns nothing
        local integer tid
    
        if not(GetSpellAbilityId() == StoneWall_SpellAbility()) then
            return
        endif
    
        //If the unit never started casting it or if the spell is
        // not channeling, nothing will be attached.
        set tid = GetStoredInteger(StoneWall_GameCache(), "StoneWall" + I2S(StoneWall_H2I(GetSpellAbilityUnit())), "Timer")
        if not(tid == 0) then
            call StoreBoolean( StoneWall_GameCache(), I2S(tid), "Stop", true )
            call FlushStoredMission(StoneWall_GameCache(), "StoneWall" + I2S(StoneWall_H2I(GetSpellAbilityUnit())))
        endif
    endfunction
    
    
    
    
    
      //Initialize the spell.
    
    function StoneWall_Go takes nothing returns nothing
        local trigger castDetector
        local trigger endDetector
    
        local timer permanentTimer
        local sound snd
    
    
        //Create Triggers:
    
        set castDetector = CreateTrigger()
        call TriggerRegisterAnyUnitEventBJ( castDetector, EVENT_PLAYER_UNIT_SPELL_EFFECT )
        call TriggerAddAction( castDetector, function StoneWall_SpellCast )
    
        set endDetector = CreateTrigger()
        call TriggerRegisterAnyUnitEventBJ( endDetector, EVENT_PLAYER_UNIT_SPELL_ENDCAST )
        call TriggerAddAction( endDetector, function StoneWall_SpellEnd )
    
    
        //Create Other Objects:
    
        set permanentTimer = CreateTimer()
        call TimerStart( permanentTimer, 10000000.00, false, null )
        call StoreInteger(StoneWall_GameCache(), "StoneWall", "GlobalTimer", StoneWall_H2I(permanentTimer))
    
    
        //Preload an Ubersplat for each level, since the filename depends on the tileset
    
        call DestroyUbersplat(CreateUbersplat(0.0, 0.0, StoneWall_UberSplat(null,1), 255, 255, 255, 255, false, false))
        call DestroyUbersplat(CreateUbersplat(0.0, 0.0, StoneWall_UberSplat(null,2), 255, 255, 255, 255, false, false))
        call DestroyUbersplat(CreateUbersplat(0.0, 0.0, StoneWall_UberSplat(null,3), 255, 255, 255, 255, false, false))
        call DestroyUbersplat(CreateUbersplat(0.0, 0.0, StoneWall_UberSplat(null,4), 255, 255, 255, 255, false, false))
        call DestroyUbersplat(CreateUbersplat(0.0, 0.0, StoneWall_UberSplat(null,5), 255, 255, 255, 255, false, false))
    
    
        //Preplay Sounds, since for some reason preloading doesn't work
    
        call TriggerSleepAction(0)
        set snd = CreateSound( StoneWall_SoundRaise(), false, false, false, 10, 10, "SpellsEAX" )
        call SetSoundVolume(snd, 0)
        call StartSound(snd)
        call KillSoundWhenDone(snd)
        set snd = CreateSound( StoneWall_SoundLower(), false, false, false, 10, 10, "SpellsEAX" )
        call SetSoundVolume(snd, 0)
        call StartSound(snd)
        call KillSoundWhenDone(snd)
    
    
        set castDetector = null
        set endDetector = null
        set permanentTimer = null
        set snd = null
    endfunction
    
    
    
    function InitTrig_StoneWall takes nothing returns nothing
        set gg_trg_StoneWall = CreateTrigger()
        call TriggerAddAction( gg_trg_StoneWall, function StoneWall_Go )
    
        //Preload:
        call Preload(StoneWall_BaseEffect(1))
        call Preload(StoneWall_BaseEffect(2))
        call Preload(StoneWall_BaseEffect(3))
        call Preload(StoneWall_BaseEffect(4))
        call Preload(StoneWall_BaseEffect(5))
        call Preload(StoneWall_SoundRaise())
        call Preload(StoneWall_SoundLower())
    endfunction
    
     
  2. game_war48

    game_war48 Dragon Quest

    Tham gia ngày:
    7/9/08
    Bài viết:
    1,320
    Nơi ở:
    Ice City
    Vì cái bên trên toàn sử dụng function mà ở patch 1.24 kô cho phép nữa >> lỗi.
    Tốt nhất là liên hệ với "tác giả" hoặc là bỏ spell này đi. Nhờ đc ai giúp sửa thì càng tốt :-@.

    nhìn sơ bộ thì các thứ sau gây ko chơi đc ở 1.24
    [spoil]
    Mã:
    function StoneWall_H2I takes handle h returns integer
        return h
        return 0
    endfunction
    
    function StoneWall_GlobalTimer takes nothing returns timer
        return GetStoredInteger(StoneWall_GameCache(), "StoneWall", "GlobalTimer")
        return null
    endfunction
    
    function StoneWall_GetPathingBlockerType takes integer level returns integer
        if StoneWall_BlocksAir(level) then
            return 'YTfc' //large both
        endif
        return 'YTpc' //large ground
    endfunction
    
    
    function StoneWall_GetLocation takes string tref, integer i returns location
        return GetStoredInteger(StoneWall_GameCache(), tref, "Location" + I2S(i))
        return null
    endfunction
    
    function StoneWall_GetPathingBlocker takes string tref, integer i returns destructable
        return GetStoredInteger(StoneWall_GameCache(), tref, "PathingBlocker" + I2S(i))
        return null
    endfunction
    
    function StoneWall_GetSightBlocker takes string tref, integer i returns destructable
        return GetStoredInteger(StoneWall_GameCache(), tref, "SightBlocker" + I2S(i))
        return null
    endfunction
    
    function StoneWall_GetSplat takes string tref, integer i returns ubersplat
        return GetStoredInteger(StoneWall_GameCache(), tref, "Splat" + I2S(i))
        return null
    endfunction
    
    function StoneWall_GetEffect takes string tref, string str, integer i returns effect
        return GetStoredInteger(StoneWall_GameCache(), tref, str + I2S(i))
        return null
    endfunction
    
    function StoneWall_GetDeform takes string tref, integer actionnum, integer i returns terraindeformation
        return GetStoredInteger(StoneWall_GameCache(), tref, "Crater" + I2S(actionnum) + "_" + I2S(i))
        return null
    endfunction
    
    function StoneWall_GetRect takes string tref returns rect
        return GetStoredInteger(StoneWall_GameCache(), tref, "Rect")
        return null
    endfunction
    
    function StoneWall_GetCaster takes string tref returns unit
        return GetStoredInteger(StoneWall_GameCache(), tref, "Caster")
        return null
    endfunction
    
    [/spoil]
    p.s: post map (chứa spell này) lên đây !
     
    Last edited by a moderator: 9/2/10
  3. huykho192

    huykho192 The Warrior of Light

    Tham gia ngày:
    9/8/08
    Bài viết:
    2,374
    vậy ai có một cái spell tương tự ko spell này là tạo ra một dãy núi chắn ngang, ko cho ai qua, giữ càng lâu thì dãy núi hiện ra càng lâu, ai có spell tương tự ko:(
    hay bạn nào rảnh edit lại cái spell hộ mình với:)
     
  4. ZhengHe

    ZhengHe T.E.T.Я.I.S

    Tham gia ngày:
    4/1/09
    Bài viết:
    623
    Ai chỉ mình làm skill 2 của abaddon trong Dota = trigger đi
     
  5. [Yami]

    [Yami] Donkey Kong

    Tham gia ngày:
    29/12/07
    Bài viết:
    313
    Nơi ở:
    Ha Noi, Vietnam,
    Ai chỉ em cách làm 1 skill Passive, mỗi lần con có skill đó cast 1 skill thì sẽ deal 1 lượng dam = lượng mana vừa dùng trong AoE 300
     
  6. WordEditor

    WordEditor C O N T R A

    Tham gia ngày:
    8/9/08
    Bài viết:
    1,509
    Nơi ở:
    Leaf Village
    Đây là 1 spell mình làm cho 1 đứa bạn, có tên là.....Ký Sinh Trùng (GUI-MUI)....hơi imba và kì kì nhưng cũng post tạm lên ;;)
    Đây là spell ultimate, khi cast spell sẽ tạo ra 1 con....bò cạp vĩnh viễn chạy theo đối phương và cắn nhè nhẹ, spell có cooldown, khi hp đối phương tương đương (số bò cạp thả ra)x100 thì sẽ bị "đột tử"...(Vd: 1 con đang truy sát thì 100 hp, 2 con thì 200 hp...), max 5 unit. Spell này có lẽ chỉ mục đích for fun, post để góp ý tưởng nếu có ai thay đổi spell cho balance hơn...:P
     

    Các file đính kèm:

    • KST.rar
      Kích thước:
      23.9 KB
      Đọc:
      19
    Chỉnh sửa cuối: 1/6/10
  7. tunghamtien

    tunghamtien Youtube Master Race

    Tham gia ngày:
    30/6/09
    Bài viết:
    79
    Xin chào mọi người
    Lần cuối cùng em post bài là khoảng 1 năm 3 tháng =))
    Sau đó em lao vào thi rùi bỏ lun WE :( .Cách đây 3 tháng quay lại làm ngon ơ (so với người mới học ).
    Em định gửi vài spell pack dota skill nhưng sao ko dc ?
    Cảm ơn mọi người vì đã giúp đỡ những newbie như em.
    Sau đây là Skill Fake Toss em làm.Gọi là fake vì nó chỉ nâng thằng bị ném ra khỏi tầm nhìn (quá cao ),rùi move đến chỗ thằng bị chọi ,ha xuống , gây dmg
    Chú thích :'A00R' là raw code của skill Toss (base on storm bolt với duration =0)
    'h000' là con dummy caster của em ,'A00S' là raw code của Thunder Clap (unit)
    ở (1) và (2) ta có thể thêm loop;exitwhen tossed ==null,thêm vào trong loop (ngay dòng đầu ) "set tossed = FirstOfGroup(gt) ;và kế dòng đó là "call GroupRemoveUnit(gt,tossed)" cuối cùng ở (2) là endloop.Như thế nó sẽ lần lượt ném từng con xung quanh (kể cả invur,miễn ko là nó)vào mục tiêu.Mới đầu làm zậy sau sửa lại .Ai check dùm nhé .2 dòng cuối set null là để xóa leak ko bit đúng ko ? Mời học Jass dc 1 tuần

    ---------- Post added at 20:25 ---------- Previous post was at 20:11 ----------

    Cho bổ sung'Armf' là raw code của SKill Crow Form , ko bít làm zậy có MUI ko .Cho em hỏi làm sao để con tossed ko lặp lại (bị ném 2 lần6) ,nếu nó lại đứng kế mình khi mình cast lần hai ?Hỏi thêm vài vấn đề :
    a)Làm skill nâng caster lẫn target lên khoảng 600 ,move caster cào target,sau 3s hạ xuống (làm dc phần này rùi),trong 3s ngoài caster ko ai đánh dc target ?
    b)skill Slow Pugna DotA : Chỉ dùng spell dc ko thể đánh tay
    c)skill 3 mana flare là báe từ melee , cho em xin các thông số để giống dotA
    d)Cho em hỏi về "Unit Take dmg" , hình như thường dùng cho crit , evsation =jass, hưng ko hiểu rõ về cái này, rùi GetDamgeEnvent, DamageSọt gì đó .Ai bít xin nói tất tần tật dùm
    Đây là jass Holy Crit :Xác xuất deal 0.175*Agi*LevelSkill damg và đưa thằng crit dến một góp random so với thang bị chém
    unction Trig_Holy_Critical_Conditions takes nothing returns boolean
    if ( not ( GetUnitAbilityLevelSwapped('A005', GetAttacker()) >= 1 ) ) then
    return false
    endif
    if (not (GetRandomInt(1,100)<=R2I(GetHeroAgi(GetAttacker(),false)/17))) then
    return false
    endif
    return true
    endfunction

    function Trig_Holy_Critical_Actions takes nothing returns nothing
    local unit chem
    local unit bichem
    local integer angl
    set chem = GetAttacker()
    set bichem =GetAttackedUnitBJ()
    set angl =GetRandomInt(1,360)
    call SetUnitPositionLocFacingBJ(chem,GetUnitLoc(bichem),I2R(angl))
    call UnitDamageTargetBJ(chem,bichem,GetHeroAgi(chem,true)*0.175*GetUnitAbilityLevelSwapped('A005',chem),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_UNIVERSAL)
    call CreateTextTagUnitBJ(R2S(GetHeroAgi(chem,true)*GetRandomReal(0.01,1.5)*GetUnitAbilityLevelSwapped('A005',chem)),bichem,0, 10, 57.00, 35.00, 84.00, 20.00)
    call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 64.00, 90 )
    call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
    call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 3.00 )
    call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 1.00 )
    set chem=null
    set bichem=null
    set angl=0
    endfunction

    //===========================================================================
    function InitTrig_Holy_Critical takes nothing returns nothing
    local trigger gg_trg_Holy_Critical
    set gg_trg_Holy_Critical = CreateTrigger( )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Holy_Critical, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddCondition( gg_trg_Holy_Critical, Condition( function Trig_Holy_Critical_Conditions ) )
    call TriggerAddAction( gg_trg_Holy_Critical, function Trig_Holy_Critical_Actions )
    endfunction

    Ko hỉu sao với mỗi target nó chỉ "nhảy" đến một góc nhất định ?
    Àh trên youtube còn có mấy cai clip lũ nước ngoài no làm spell như quái vật , cứ gõ Custom Spell Jass
    Vd:
    [video]http://www.youtube.com/watch?v=f-RNglxqkgg[/video]

    ---------- Post added at 20:27 ---------- Previous post was at 20:25 ----------

    Ngoài ra em còn làm dc một số ulti (ko MUI) của DotA ai cần cứ nhờ làm dc tới đâu hay tới đó =))
     
  8. thikchoigame

    thikchoigame Youtube Master Race

    Tham gia ngày:
    29/5/10
    Bài viết:
    61
    Nơi ở:
    HN
    OMG, mấy bác pro wá, em nhìn không hỉu j hết :D. em chỉ mún hỏi: hiện em đang làm skill ulti của con vs trong DotA đóa. tại sao em chỉnh trigger nhìn có vẻ ổn ( để mai em copy cho), lúc test thử thì : nó bay về chỗ mình thật, còn mình bay về.... đúng giữa bản đồ lun ( center). Why?
     
  9. Tom_Kazansky

    Tom_Kazansky

    Tham gia ngày:
    28/12/06
    Bài viết:
    3,454
    Nơi ở:
    Hà Nội
    sau mà muốn giúp về trigger thì phải post trigger lên, đừng có "để mai em copy cho" <-- nếu thế này thì đừng có post bài

    và nếu trigger GUI thì ĐỂ NGUYÊN GUI, đừng có mà CONVERT RA JASS rồi post lên, không ai đọc code convert đâu
     
  10. oaioaioi

    oaioaioi Donkey Kong

    Tham gia ngày:
    5/4/07
    Bài viết:
    341
    Nơi ở:
    Elgaill Town
    Có ai làm Spell này dùm mình ko :
    - Spell phóng ra 1 missile đi theo đường thẳng (đi khoảng 600-800 roài nổ),
    - Trên đường đi nếu gặp các mục tiêu thì đi xuyên qua mục tiêu nhưng vẫn deal damage và có hiệu ứng nổ ở mục tiêu.
    - Spell có thể là băng, sét hoặc độc.
    - Auto-Cast
    Ai làm giúp mình nha :D
     
  11. tunghamtien

    tunghamtien Youtube Master Race

    Tham gia ngày:
    30/6/09
    Bài viết:
    79
    Sao ko ai trả lời mấy câu hỏi của em hết vây ? Mà thực sự em chỉ dùng GUI ở Event và COndition thui , còn lại là gõ trên Jass hết.Cho em hỏi tất cả các spell trân này đều phải post bằng GUI hết sao ?
     
  12. Tom_Kazansky

    Tom_Kazansky

    Tham gia ngày:
    28/12/06
    Bài viết:
    3,454
    Nơi ở:
    Hà Nội
    spell GUI thì post GUI còn spell JASS thì post JASS

    CHỨ KHÔNG PHẢI post spell GUI CONVERT RA JASS
    ---
    còn post GUI ra sao thì: chọn một trigger, ở tên trigger ở bên phải, ấn chuột phải rồi Copy As Text rồi paste vào thẻ "CODE",
    dùng biểu tượng [​IMG] hoặc: [CODE]<paste vào đây>[/CODE]
     
  13. rongdoVN

    rongdoVN Space Marine Doomguy Lão Làng GVN

    Tham gia ngày:
    6/9/05
    Bài viết:
    5,663
    Nơi ở:
    TS-Pri GameVN
    cái event với cái condition của jass cũng đâu có gì khó khăn đâu , gõ luôn đi cho nó ra jass :|
     
  14. tunghamtien

    tunghamtien Youtube Master Race

    Tham gia ngày:
    30/6/09
    Bài viết:
    79
    Thường thì cái vụ bay về giữa là point bị trả về null (rỗng)
    Tạo 1 spell Chain Lighting với dmg =0,number of target =1 range tùy
    Cái action bạn làm như sau :
    À đừng kêu mình bằng anh nha bạn
    Thực ra trigger ko khó lắm , sao bạn ko suy nghĩ :
    Cái dòng thứ hai :
    Chẳng phải là shockwave sao =))
    Vấn đề là nố .Thực ra là đợi ((Độ dài đường di của đạn//còn gọi là distance//):tốc độ đạn ),sau đó nổ .Khi bạn tạo 1 skill shockwave thì tốc đô đạn hình như là 1050
    Mình hơi lười chỉ up phần action thui :
    Bạn xóa leak hộ mình :D , chống chỉ định click vào unit
    Còn auto cast với băng điện gì hẹn bữa sau.
     
  15. oaioaioi

    oaioaioi Donkey Kong

    Tham gia ngày:
    5/4/07
    Bài viết:
    341
    Nơi ở:
    Elgaill Town

    1. Thanks bạn đã giúp đỡ. Thực ra mình ko hiểu về các ngôn ngữ lập trình lắm nên thường chỉnh sửa trên các skill có sẵn :chicken:
    Mình chỉ cần skill đơn giản và hiệu quả, chủ yếu dựa trên skill default và có khả năng auto-cast. Tuy nhiên do chưa nắm rõ về trigger, GUI, jass, vjass,... nên khi viết skill đầy lỗi và leak :chicken:

    2. Nếu được mình nhờ các bạn up nhiều skill demo về auto-cast spell với missile có đường đi khác thường hoặc đường đi phức tạp, nhiều animation, effect để mình học hỏi. (Auto cast nova, shock wave, chain-lightning hay nhiều chiêu phức tạp hơn,....). Mình đã xem bài của mod Tom về Auto-cast và xem 1 số spell mọi người post lên nhưng đa số là Auto-cast chỉ có 1 Missile đi theo đường thẳng mà thôi :|

    3. Nhân tiện các bạn có thể chỉ mình cách làm skill passive + damage có hiệu ứng băng (làm chậm), sét (choáng), độc (rút máu) nhưng ko dựa trên hiệu ứng của Orb, Item và có thể stack chung với nhau (khi đánh có đủ 3 hiệu ứng choáng, chậm, rút máu) và có tác dụng cho cả melee và ranger attack.

    P/S: (stack ở đây có phải là xài chung mà ko đụng hàng ko nhỉ :chicken:, ví dụ cầm Orb băng chung với Orb sét thì chỉ có 1 hiệu ứng được cộng vào hero vì 2 cái Orb nó đụng nhau. Mình có xem Guide về Orb Effect mà nó stack, non-stack tùm lum, vả lại Orb còn phân biệt hỗ trợ melee attack và ranged attack nên mình ko muốn làm skill passive dựa trên Orb) :(

    @Tom_Kazansky: À cuối mỗi dòng mình add 1 mặt cười thôi thì có bị xem là spam mặt cười ko, hix lần trước gõ nhiều mặt cười quá nên bị nhắc nhở. :)
     
  16. chomap007

    chomap007 Donkey Kong

    Tham gia ngày:
    20/11/06
    Bài viết:
    402
    trong map này có vài thứ bạn cần, download về thử xem :).
    http://epicwar.com/maps/135941/
     
  17. oaioaioi

    oaioaioi Donkey Kong

    Tham gia ngày:
    5/4/07
    Bài viết:
    341
    Nơi ở:
    Elgaill Town
    Thanks nhé, vừa Test xong nhưng ko thấy có spell Auto-cast nào hay cả :(
    Passive thì nhiều quá chưa xem hết vì toàn thiếu tool-tip :(
    Mà nhiều spell thật :| test 20 phút mệt oài :|
     
  18. lucifekit

    lucifekit The Warrior of Light

    Tham gia ngày:
    25/2/06
    Bài viết:
    2,344
    ^
    ^
    Autocast đơn giản là dựa trên 1 skill arrow để tạo buff lên người đối phương.

    Có 1 event để kiểm tra sự kiện 1 unit nhận sát thương thì kiểm tra unit đó có dính cái buff kia không,nếu có thì trigger được chạy.Bạn muốn tùy biến spell như nào thì sửa ở trigger đó.Và remove cái buff kia đi.
    Ví dụ:
    Autocast chain : Muốn auto-cast chain lighting thì tạo 1 dummy unit cast chain lighting lên unit dính buff.
    Autocast nova : Muốn auto-cast nova thì cast frost nova.
    Autocast line : Cast crushingwave,shockwave,carrion swarm vào vị trí unit dính buff.
    Autocast tại chỗ : Cast cái chiêu dậm của tướng nhà human.
    Autocast rain : Cast blizzard/fire storm vào vị trí unit dính buff.
    Và các tùy biến cao hơn nữa.
     
  19. tunghamtien

    tunghamtien Youtube Master Race

    Tham gia ngày:
    30/6/09
    Bài viết:
    79
    Ban ui cho mình xin lỗi nhé
    cái này :
    Sửa thành :
    Tự dưng sáng sớm thức dậy chợt giật mình nhớ ra =))
     
  20. Tom_Kazansky

    Tom_Kazansky

    Tham gia ngày:
    28/12/06
    Bài viết:
    3,454
    Nơi ở:
    Hà Nội
    uh, và cái đó leak 2 point =))
     
Trạng thái chủ đề:
Không mở trả lời sau này.

Chia sẻ trang này