• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[vJASS] My spell works good on 1.27b but its bugged on Reforged

Status
Not open for further replies.
Level 7
Joined
Jan 23, 2011
Messages
350
I imagine this is a common ocurrence, but i'd still like some clarification as to why this happens


These are the 2 bugged abilities, and the bugged system is this:
[vJASS] - [System] Illusion

JASS:
scope Doppelwalk initializer Init

globals
    private constant integer        DUMMY_ID     =   'dumy'
    private constant integer        SPELL_ID    =   'A000'
    private constant real           ILLU_DUR    =   8.00
    private constant real       ILLU_DMG_TAKEN  =   4.00
    private constant real       ILLU_DMG_DONE   =   0.25
endglobals

//========================Conditions=============================
private function Conditions takes nothing returns boolean
    return GetSpellAbilityId() == SPELL_ID
endfunction

private function onEffect takes nothing returns boolean
    local unit u = GetTriggerUnit()
    local Illusion illu = Illusion.create(GetTriggerPlayer(), u, GetUnitX(u), GetUnitY(u))
    local real a = GetUnitFacing(u)*bj_DEGTORAD
    local real dx= GetUnitX(u) +256*Cos(a)
    local real dy= GetUnitY(u) +256*Sin(a)
    set illu.duration = ILLU_DUR
    set illu.damageTaken = ILLU_DMG_TAKEN
    set illu.damageGiven = ILLU_DMG_DONE
    call IssuePointOrder(illu.unit,"move", dx, dy)
    set u = null
    return false
endfunction


//==================================================================================================================
    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        //==========================================================
        call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_ENDCAST)
        call TriggerAddCondition( t , Condition(function Conditions ))
        call TriggerAddAction( t , function onEffect )           
        set t = null
        //===========================================================
    endfunction
    //=====

endscope

JASS:
scope Doppelwalk initializer Init

globals
    private constant integer        DUMMY_ID     =   'dumy'
    private constant integer        SPELL_ID    =   'A000'
    private constant real           ILLU_DUR    =   8.00
    private constant real       ILLU_DMG_TAKEN  =   4.00
    private constant real       ILLU_DMG_DONE   =   0.25
endglobals

//========================Conditions=============================
private function Conditions takes nothing returns boolean
    return GetSpellAbilityId() == SPELL_ID
endfunction

private function onEffect takes nothing returns boolean
    local unit u = GetTriggerUnit()
    local Illusion illu = Illusion.create(GetTriggerPlayer(), u, GetUnitX(u), GetUnitY(u))
    local real a = GetUnitFacing(u)*bj_DEGTORAD
    local real dx= GetUnitX(u) +256*Cos(a)
    local real dy= GetUnitY(u) +256*Sin(a)
    set illu.duration = ILLU_DUR
    set illu.damageTaken = ILLU_DMG_TAKEN
    set illu.damageGiven = ILLU_DMG_DONE
    call IssuePointOrder(illu.unit,"move", dx, dy)
    set u = null
    return false
endfunction


//==================================================================================================================
    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        //==========================================================
        call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_ENDCAST)
        call TriggerAddCondition( t , Condition(function Conditions ))
        call TriggerAddAction( t , function onEffect )           
        set t = null
        //===========================================================
    endfunction
    //=====

endscope
 

Attachments

  • Phantom lancer spells.w3x
    61 KB · Views: 17
Status
Not open for further replies.
Top