• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Spell Request : Rocket

Status
Not open for further replies.
Level 9
Joined
Apr 7, 2010
Messages
480
can someone make a spell that creates a rocket in front of the caster and moves forward upon cast *no targets required*. add rocket the same height as the caster. also making a timer that let the rocket explode when no unit gets hit damaging all units on a certain distance.

thanks in advance.
please post when details are not enough/not clear.
 
Level 9
Joined
Apr 7, 2010
Messages
480
mckill. i think the spell(Spawn bomb) you posted is what im looking for, but if ever i change the target type to no target required. i guess the spell would mess up. so can you please make a test map? ive tried it many times with arrow from mirana (dota) but ended up with projectile moving randomly also never succeed with changing the projectile height.
 
Level 15
Joined
Oct 18, 2008
Messages
1,591
Mirana's arrow is one to be shot at a great distance after some channel, I think it's unit targeted but flies in a straight line. If you play LoL then same as Ashe's or Ezreal's arrow with unit target instead of point. It's pretty easy to change target tough. What you missed Klann is that the ability uses "Position of (Target unit of ability being cast)" look for this in the trigger and change all of them to "Event Response - Target point of ability being cast"
 
Level 9
Joined
Apr 7, 2010
Messages
480
mckill, this is a simple description of the dota spell i mentioned <-- if ur interested in knowing. not part of my request.
"it casts an arrow(projectile) in front of the caster and moves straight to the target point(like kanadaj said).
anyways, you can set it any distance you like.

kanadaj, what i meant is changing the spell from "with target" to "no target". after changing the spell to "no target" the spell messes up making the projectile move to random areas.
 
Level 15
Joined
Oct 18, 2008
Messages
1,591
not random areas, the center of the map, as the spell takes the position of the target

if you remove it, it gets a default position, which is 0,0 - the very center of the map. But why do you want "no target"? don't u want "point target" instead of "unit target"?

if yes, I told you what you have to look for in the trigger
 
Level 9
Joined
Apr 7, 2010
Messages
480
mckill, thx..

kanadaj, im trying to make a jet game. well, the unit moves forward automatically. so. that would make a targeted spell harder. Also, im trying to make the gameplay real as possible.
 
Level 9
Joined
Apr 7, 2010
Messages
480
its vjass. :'(

thx anyways. +rep, i'll just post on trigger and scripts tomorrow if anyone could help me convert it since i dont understand vjass. also. i would like to get your permission so there won't be any problems. its already late here. goodnyt.
 
Level 9
Joined
Apr 7, 2010
Messages
480
having a problem.

Line 192 : undeclared variable DATA ( local integer this= DATA )
Line 221 : undeclared variable DATA ( set DATA = this )

srry. i really dont understand jass.
 
Level 9
Joined
Apr 7, 2010
Messages
480
JASS:
//TESH.scrollpos=0
//TESH.alwaysfold=0
//Spell Name: Force Arrow
//Made by: Mckill2009

library ForceArrow needs MapBounds 

globals
    private constant hashtable                HASH = InitHashtable() //Dont touch!
    private constant integer              SPELL_ID = 'A000' //roar
    private constant integer            MISSILE_ID = 'h001' //just change this model
    private constant real                      AOE = 250
    private constant real                 PERIODIC = 0.03125
    private constant real                    SPEED = 15
    private constant attacktype                ATK = ATTACK_TYPE_CHAOS
    private constant damagetype                DMG = DAMAGE_TYPE_NORMAL
    private constant string                    SFX = "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl"
    private constant group                FA_GROUP = CreateGroup()
    private integer CHECK = 0
endglobals

private function GetDamage takes integer i returns real
    return 50 + i * 50.
endfunction

private function GetDistance takes integer i returns real
    return 500 + i * 100.
endfunction

private module Init
    private static method onInit takes nothing returns nothing
        local trigger t1 = CreateTrigger()
        local trigger t2 = CreateTrigger()
        call TriggerRegisterAnyUnitEventBJ(t1, EVENT_PLAYER_UNIT_SPELL_EFFECT)
        call TriggerAddCondition(t1, Condition(function thistype.go))
        call TriggerRegisterTimerEvent(t2, PERIODIC, true)
        call TriggerAddCondition(t2, Condition(function thistype.runloop))
        set t1 = null
        set t2 = null
    endmethod
endmodule

private struct FA
    unit caster
    unit missile
    integer level
    real x
    real y
    real damage
    real angle
    real distance
    real height
    real distx
    
    static thistype DATA
    
    static method damagethem takes nothing returns boolean
        local thistype this = DATA
        local unit u = GetFilterUnit()
        if GetWidgetLife(u) > 0.405 and IsUnitEnemy(u, GetOwningPlayer(.missile)) then
            call UnitDamageTarget(.missile, u, .damage, false, false, ATK, DMG, null)
        endif        
        set u = null
        return false
    endmethod
    
    static method looper takes nothing returns nothing
        local unit u = GetEnumUnit()
        local thistype this = LoadInteger(HASH, GetHandleId(u), 1)
        local integer i = 0
        local real x
        local real y
        local real x1
        local real y1
        
        if .distance > .distx then
            set .distx = .distx + SPEED
            set x = .x + .distx * Cos(.angle*bj_DEGTORAD)
            set y = .y + .distx * Sin(.angle*bj_DEGTORAD)
            call SetUnitX(.missile, x)
            call SetUnitY(.missile, y)
        else
            set x1 = GetUnitX(.missile)
            set y1 = GetUnitY(.missile)
            call KillUnit(.missile)
            call DestroyEffect(AddSpecialEffect(SFX, x1, y1))
            set DATA = this
            call GroupEnumUnitsInRange(bj_lastCreatedGroup, x1, y1, AOE, Filter(function thistype.damagethem))
            call GroupRemoveUnit(FA_GROUP, .missile)
            set CHECK = CHECK - 1
            call .destroy(this)
            call FlushChildHashtable(HASH, GetHandleId(.missile))
        endif
        set u = null
    endmethod
    
    static method create takes unit u, integer level, real x, real y returns thistype
        local thistype this = thistype.allocate()
        set .distx = 0
        set .angle = GetUnitFacing(u)
        set .distance = GetDistance(level)
        set .missile = CreateUnit(GetTriggerPlayer(), MISSILE_ID, x, y, 0)
        set .damage = GetDamage(level)
        set .x = x
        set .y = y
        set CHECK = CHECK + 1
        call GroupAddUnit(FA_GROUP, .missile)
        call SaveInteger(HASH, GetHandleId(.missile), 1, this) 
        return this
    endmethod
    
    static method go takes nothing returns boolean
        local unit u
        local integer level
        if GetSpellAbilityId()==SPELL_ID then
            set u = GetTriggerUnit()
            set level = GetUnitAbilityLevel(u, SPELL_ID)
            call FA.create(u, level, GetUnitX(u), GetUnitY(u))
        endif
        set u = null
        return false
    endmethod
    
    static method runloop takes nothing returns boolean
        if CHECK > 0 then
            call ForGroup(FA_GROUP, function thistype.looper)
        endif
        return false
    endmethod
    
    implement Init
    
endstruct

endlibrary
 
Things to consider;
- replace the raw codes for SPELL_ID and MISSILE_ID coz the code in your
map might be different, raw codes are 'A000', 'h001', view it by pressing CTRL+D from your object editor
- Copy the code MapBounds to your map
- Install the latest JassHelper >>> http://www.wc3c.net/showthread.php?t=88142
- Reinventing the Craft must be disabled
- Configure your JNGP >>> http://www.hiveworkshop.com/forums/...456/how-download-install-confige-jngp-160547/
- If error still occurs, then post your map here

JNGP is Jass New Gen Pack
 
Status
Not open for further replies.
Top