wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Spells
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 04-19-2007, 11:13 PM   #16
Dil999
CUSTOM USER TITLE!!!!!!!!
 
Dil999's Avatar
 
Join Date: Dec 2006
Posts: 740

Dil999 has a spectacular aura about (82)Dil999 has a spectacular aura about (82)Dil999 has a spectacular aura about (82)

Send a message via AIM to Dil999 Send a message via MSN to Dil999 Send a message via Yahoo to Dil999
Default

Quote:
Originally Posted by Chuckle_Brother
Bug found...that lightning blast that strikes units in its path, well it seems to be giving the target soulburn...while unholy lightning doesnt.....
If you imported the spells into your own map, Did you change the rawcodes for stuff?
__________________
Early man walked away as modern man took control.
Their minds weren't all the same, to conquer was his big goal,
So he built his great empire and slaughtered his own kind,
Then he died a confused man, killed himself with his own mind.
Dil999 is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 07-03-2007, 01:20 AM   #17
~Void~
Inactive as fuck
 
Join Date: Jun 2007
Posts: 496

Submissions (39)

~Void~ is a jewel in the rough (213)~Void~ is a jewel in the rough (213)~Void~ is a jewel in the rough (213)~Void~ is a jewel in the rough (213)

Default

Quote:
Hoarfrost
You know Bhaal's most annying but coolest spell. A frost wave that pushes targets back.

Bhaal?
__________________
~Void~ is offline   Reply With Quote
Old 08-28-2007, 09:15 AM   #18
jonadrian619
User
 
jonadrian619's Avatar
 
Join Date: Oct 2006
Posts: 69

Submissions (9)

jonadrian619 is on a distinguished road (15)

Default

Cool!! Very efficient.. I'll use this in future maps..
__________________




Game Interface Tutorials
Basics | Custom Training Queue
Other Tutorials
How to make Custom Skies
jonadrian619 is offline   Reply With Quote
Old 11-12-2008, 01:01 AM   #19
Frozenhelfire
User
 
Join Date: Apr 2008
Posts: 49

Frozenhelfire has little to show at this moment (0)

Default

I tried implementing the splitting lightning into my map, but I wanted it to use Rising_Dusk's Damage Detection system and hit mechanical units. I went wrong somewhere because it is no longer functioning. I mainly changed the condition line to include anything that is not a structure or dead. I also changed the damage dealings to UnitDamageTargetEx() and commented out the other ones.

Rising_Dusk's Damage Detection System
Collapse JASS:
//*******************************************************************************
//*                                                                             *
//*                     D A M A G E  D E T E C T I O N                          *
//*                              Actual Code                                    *
//*                                 v1.06                                       *
//*                                                                             *
//*                            By: Rising_Dusk                                  *
//*                                                                             *
//*******************************************************************************

library DamageSystem initializer DamageSystemInit
globals
    //*********************************************************
    //* These are the configuration constants for the system
    //*
    //* DummyUnitID:        What the dummy unit raw ID is for your map
    //* DamageTypeCount:    The number of damage types declared in the system
    //*
    private constant integer DummyUnitID           = 'hfoo'
    private integer DamageTypeCount                = 3
    
    //*********************************************************
    //* These are the constant globals for ease of use
    //*
    constant integer DAMAGE_TYPE_ATTACK            = 0
    constant integer DAMAGE_TYPE_SPELL             = 1
    constant integer DAMAGE_TYPE_EXTRA             = 2
    
    //* To add new constants, simply follow the naming convention and increment
    //* the number accordingly. You shouldn't change or remove the first of the
    //* damage types, since it is a special case, but you can change the others
    //* however you'd like.
    
    //*********************************************************
    //* These are static constants used by the system and shouldn't be changed
    //*
    //* RunTrigger:         The trigger that runs on the damage event             
    //* AddTrigger:         The trigger that adds the damage event
    //* Count:              Counts how many registrations exist
    //* Cache:              The game cache used by the system
    //*
    //* Trg:                The trigger array with acts/conds to fire
    //* TrgCount:           Arbitrary maximum of how many events will be
    //*                     registered at once. This is only used during
    //*                     initialization and making this arbitrarily large
    //*                     (But under 8191) is not problematic.
    //* 
    public trigger RunTrigger                      = CreateTrigger()
    public trigger AddTrigger                      = CreateTrigger()
    private integer Count                          = 0
    private gamecache Cache                        = null
    
    private trigger array Trg
    private constant integer TrgCount              = 256
    
    //* Temporary variables used by the system
    private unit DamageSource                      = null
    private unit DamageTarget                      = null
    private integer DamageType                     = 0
    private real Damage                            = 0.
endglobals

//******************************************************************************
//******************************************************************************

private function H2I takes handle h returns integer
    return h
    return 0
endfunction

//******************************************************************************
//******************************************************************************

//* The new damage function used by the system
function UnitDamageTargetEx takes unit source, unit target, real damage, attacktype attackType, integer damageType, boolean ConsiderArmor returns boolean
    local boolean b = false
    set DamageType = damageType
    set DamageSource = source
    if ConsiderArmor then
        set b = UnitDamageTarget(source, target, damage, false, false, attackType, DAMAGE_TYPE_NORMAL, null)
    else
        set b = UnitDamageTarget(source, target, damage, false, false, attackType, DAMAGE_TYPE_UNIVERSAL, null)
    endif
    if not b then
        set DamageType = 0
        set DamageSource = null
    endif
    return b
endfunction

//* The method by which one registers a trigger with the system
function TriggerRegisterDamageEvent takes trigger trg returns boolean
    if trg == null then
        return false
    endif
    set Trg[Count] = trg
    call StoreInteger(Cache, I2S(H2I(trg)), SCOPE_PREFIX+"Index", Count)
    set Count = Count + 1
    return true
endfunction

//* The method by which one unregisters a trigger from the system
function TriggerUnregisterDamageEvent takes trigger trg returns boolean
    local integer i = 0
    if trg == null then
        return false
    endif
    set i = GetStoredInteger(Cache, I2S(H2I(trg)), SCOPE_PREFIX+"Index")
    if trg != Trg[i] then
        return false
    endif
    set Trg[i] = Trg[Count]
    call StoreInteger(Cache, I2S(H2I(Trg[i])), SCOPE_PREFIX+"Index", i)
    set Count = Count - 1
    return true
endfunction

//* Initialization shorthand to register a new damage type externally
function RegisterDamageType takes nothing returns integer
    local integer i = DamageTypeCount
    set DamageTypeCount = DamageTypeCount + 1
    return i
endfunction

//******************************************************************************
//******************************************************************************

//* Wrappers for the system that can get inlined anyways
function GetTriggerDamageType takes nothing returns integer
    return DamageType
endfunction
function GetTriggerDamageSource takes nothing returns unit
    return DamageSource
endfunction
function GetTriggerDamageTarget takes nothing returns unit
    return DamageTarget
endfunction
function GetTriggerDamage takes nothing returns real
    return Damage
endfunction

//******************************************************************************
//******************************************************************************

private function RunConditions takes nothing returns boolean
    //* The conditions for what must be true for damage detection to run
    return GetEventDamage() >= 0.0001
endfunction

private function AddConditions takes nothing returns boolean
    //* The conditions for registering a unit with the damage system
    return true
endfunction

private function PreloadConditions takes unit u returns boolean
    //* The conditions for preloading a unit to the damage system
    return true
endfunction

//******************************************************************************
//******************************************************************************

private function Run takes nothing returns nothing
    local unit u = GetEventDamageSource()
    local unit s = DamageSource
    local unit t = GetTriggerUnit()
    local integer i = 0
    local integer d = DamageType
    local real r = GetEventDamage()
    
    if DamageSource == null then
        set d = DAMAGE_TYPE_ATTACK
        set s = u
    endif
    loop
        exitwhen i > Count
        set Damage = r
        set DamageTarget = t
        set DamageSource = s
        set DamageType = d
        if IsTriggerEnabled(Trg[i]) and TriggerEvaluate(Trg[i]) then
            call TriggerExecute(Trg[i])
        endif
        set i = i + 1
    endloop
    set Damage = 0.
    set DamageTarget = null
    set DamageSource = null
    set DamageType = 0
    
    set u = null
    set s = null
    set t = null
endfunction

private function Load takes nothing returns nothing
    call TriggerRegisterUnitEvent(RunTrigger, GetEnteringUnit(), EVENT_UNIT_DAMAGED)
endfunction

//******************************************************************************
//******************************************************************************

private function PreloadUnits takes nothing returns boolean
    if PreloadConditions(GetFilterUnit()) then
        call TriggerRegisterUnitEvent(RunTrigger, GetFilterUnit(), EVENT_UNIT_DAMAGED)
    endif
    return false
endfunction

private function DamageSystemInit takes nothing returns nothing
    local rect r = GetWorldBounds()
    local region re = CreateRegion()
    local boolexpr b = Condition(function PreloadUnits)
    local group g = CreateGroup()
    local integer i = 0
    
    call FlushGameCache(InitGameCache("GameCache.x"))
    set Cache = InitGameCache("GameCache.x")
    
    set RunTrigger = CreateTrigger()
    call TriggerAddAction(RunTrigger, function Run)
    call TriggerAddCondition(RunTrigger, Condition(function RunConditions))
    call GroupEnumUnitsInRect(g, r, b)
    
    set AddTrigger = CreateTrigger()
    call RegionAddRect(re, r)
    call TriggerRegisterEnterRegion(AddTrigger, re, null)
    call TriggerAddAction(AddTrigger, function Load)
    call TriggerAddCondition(AddTrigger, Condition(function AddConditions))
    
    loop
        exitwhen i > TrgCount
        set Trg[i] = null
        set i = i + 1
    endloop
    
    call RemoveRect(r)
    call DestroyGroup(g)
    call DestroyBoolExpr(b)
    set re = null
    set g = null
    set b = null
    set r = null
endfunction
endlibrary


Splitting Lightning
Collapse JASS:
//***************************************************************************************************
//* ===================   
//* Splitting Lightning - No chategory.   
//* ===================  
//* Made by Daminon. 
//* 
//*
//* How to implement:
//* ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
//* 1. Copy the spell "Splitting Lightning" into your map. 
//*
//* 2. Copy this trigger into your map.
//*
//* 
//* Data info:
//* ŻŻŻŻŻŻŻŻŻŻ
//* Special effect on initial target = Target, this is just to get the sound of the extra lightnings. 
//* 
//* Trigger added damage = true
//*
//* 
//* Targets allowed:
//* ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ   
//* Used by the triggering spell. 
//* Enemy + target options 
//*
//***************************************************************************************************


//VARABLE CONFIGURATION

//Implementation
//---------------------------------------------------------------------------------------------------
constant function SplittingLightning_SpellId takes nothing returns integer
    //The rawcode of the triggering spell.
    return 'A05F'
endfunction
//---------------------------------------------------------------------------------------------------

//Ability data
//---------------------------------------------------------------------------------------------------
constant function SplittingLightning_MaxTargets takes integer Level returns integer
    //The amount of extra targets.
    return Level + 1 
endfunction
//---------------------------------------------------------------------------------------------------
function SplittingLightning_Radius takes real Level returns real
    //The radius. Know that this vaule must not be higher than the cast range of the triggering and
    //the dummy spell. 
        return 350 + Level * 0
endfunction
//---------------------------------------------------------------------------------------------------
function SplittingLightning_TargetOptions takes nothing returns boolean 
    //Target options to decide which units shall be cound as valid targets.
    return GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) > 0 and (IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE)) == false// and not(IsUnitType(GetFilterUnit(), UNIT_TYPE_FLYING)) and not(IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE)) and GetOwningPlayer(GetFilterUnit()) != Player(PLAYER_NEUTRAL_PASSIVE)
endfunction
//---------------------------------------------------------------------------------------------------
function SplittingLightning_Damage takes real Level returns real 
    //Damage dealed to all targets.
    return 120 + Level * 20 
endfunction
//---------------------------------------------------------------------------------------------------


//SPELL CODE
//===================================================================================================
function Trig_SplittingLightning_Actions takes nothing returns nothing  
    local unit C = GetSpellAbilityUnit() 
    local unit T = GetSpellTargetUnit() 
    local unit F   
    local integer L = GetUnitAbilityLevel(C, SplittingLightning_SpellId())  
    local integer MT = SplittingLightning_MaxTargets(L)  
    local integer MMT = 0
    local integer DId = GetDummyId() 
    local integer LiI = 0
    local location Lo = GetUnitLoc(T)
    local real R = SplittingLightning_Radius(L) 
    local real X1 = GetLocationX(Lo)
    local real Y1 = GetLocationY(Lo)
    local real Z1 = GetLocationZ(Lo)
    local real X2 = GetUnitX(C)
    local real Y2 = GetUnitY(C)
    local real Z2  
    local real D = SplittingLightning_Damage(L)
    local group G1 = CreateGroup() 
    local group G2 = CreateGroup()
    local boolexpr TO = Condition(function SplittingLightning_TargetOptions)
    local lightning array Li
    local player O = GetOwningPlayer(C)
    
    call RemoveLocation(Lo)
    call TriggerSleepAction(0.1) 
                                                                                                               
    call GroupEnumUnitsInRange(G1, X1, Y1, R, TO)                                                    
    call GroupRemoveUnit(G1, T)
    //call UnitDamageTarget(C, F, D, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS)
    call UnitDamageTargetEx(C, F, D, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_SPELL, false)
   
    set bj_wantDestroyGroup = false 
    
    if (CountUnitsInGroup(G1) > 0) then
        call DestroyEffect(AddSpellEffectById(SplittingLightning_SpellId(), EFFECT_TYPE_TARGET, X1, Y1))    
           
        loop 
            set F = FirstOfGroup(G1) 
            exitwhen (F == null)  
            if (IsUnitEnemy(F, O)) then
                call GroupAddUnit(G2, F)  
            endif  
            call GroupRemoveUnit(G1, F)
        endloop 
    
        set bj_wantDestroyGroup = false
        set MMT = CountUnitsInGroup(G2)
    
        if (MMT <= MT) then
            call GroupAddGroup(G2, G1)  
        else
            call GroupClear(G1)
            set G1 = GetNClosestUnits(G2, X1, Y1, R, MT)
        endif
    
        loop 
            set F = FirstOfGroup(G1)
            exitwhen (F == null) 
            //call UnitDamageTarget(C, F, D, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS)
            call UnitDamageTargetEx(C, F, D, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_SPELL, false)
            set Lo = GetUnitLoc(F)
            set X2 = GetLocationX(Lo)
            set Y2 = GetLocationY(Lo)
            set Z2 = GetLocationZ(Lo)
            call RemoveLocation(Lo)
            set Li[LiI] = AddAttachedLightningEx("CLPB", false, T, Z1, F, Z2)
            set LiI = LiI + 1
            call GroupRemoveUnit(G1, F) 
        endloop 
    
        call TriggerSleepAction(0.7)
    
        loop
            call DestroyAttachedLightning(Li[LiI])
            exitwhen (LiI == 0)
            set LiI = LiI - 1
        endloop
    endif
    
    call RemoveLocation(Lo)
    call DestroyGroup(G2)
    call DestroyGroup(G1)
    call DestroyBoolExpr(TO)
    set G2 = null
    set G1 = null
    set Lo = null
    set TO = null
    set C = null 
    set T = null 
    set F = null
    set O = null
endfunction 


//EVENT AND CONDTION 
//===================================================================================================
function Trig_SplittingLightning_Conditions takes nothing returns boolean  
    return GetSpellAbilityId() == SplittingLightning_SpellId()
endfunction  


function InitTrig_SplittingLightning takes nothing returns nothing  
    set gg_trg_SplittingLightning = CreateTrigger(  )  
    call TriggerRegisterAnyUnitEventBJ( gg_trg_SplittingLightning, EVENT_PLAYER_UNIT_SPELL_EFFECT )  
    call TriggerAddCondition( gg_trg_SplittingLightning, Condition( function Trig_SplittingLightning_Conditions ) )  
    call TriggerAddAction( gg_trg_SplittingLightning, function Trig_SplittingLightning_Actions )  
endfunction 
Frozenhelfire is offline   Reply With Quote
Old 08-24-2010, 05:09 PM   #20
busterkomo
User
 
Join Date: Aug 2007
Posts: 68

Submissions (1)

busterkomo is on a distinguished road (10)

Default

These spells are not vJass, so why are they categorized as such?
busterkomo is offline   Reply With Quote
Old 08-24-2010, 10:31 PM   #21
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Quote:
Originally Posted by busterkomo
These spells are not vJass, so why are they categorized as such?
Likely an error. The spell resource categories have been reworked in the past (we had a resource section before vJass even existed) and apparently this spell was not moved where it should have been.
__________________
Anitarf is offline   Reply With Quote
Old 01-15-2011, 02:20 PM   #22
MrTanga23
User
 
Join Date: Jan 2011
Posts: 2

MrTanga23 has little to show at this moment (0)

Default



Nice MAP

^^
MrTanga23 is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 06:36 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services