Paste #68630: Untitled Paste

Date: 2020/05/06 22:31:50 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


firespell_path:
    type: task
    script:
    - playeffect flame <player.location> visibility:100 quantity:<[particleamount]>
    - playeffect redstone <player.location> special_data:1|blue visibility:1000 quantity:<[particleamount]>
    - foreach <[path]>:
        - wait 1t
        - define projectile <[value].find.living_entities.within[<[size]>]>
        - playsound ENTITY_ILLUSIONER_CAST_SPELL <player.location> pitch:<[soundpitch]>
        - playeffect redstone <[value].simple.as_location> special_data:1|orange visibility:1000 quantity:<[particleamount]>
        - playeffect redstone <[value].simple.as_location> special_data:1|red visibility:250 quantity:<[particleamount]>
        #if true this is a direct hit and will stop the projectile mid flight at <[value]> location
        - if !<[projectile].is_empty>:
            - define directhit:true
            #redefines the target to the location of where the projectile stopped
            - define target:<[value]>
            #puts directly impacted entities into list
            - foreach <[projectile]>:
                - if <[direct_entities]> == null:
                    - define direct_entities:<-:null
                - define direct_entities:->:<[value]>
            - playeffect flame <[target]> visibility:100 quantity:<[particleamount]> offset:<[offset]>
            - inject firespell_listener
    - playeffect flame <[target]> visibility:100 quantity:<[particleamount]> offset:<[offset]>
    - inject firespell_listener
firespell_listener:
    type: task
    script:
    #list each entity near projectile hit
    - define near_entities <[target].find.living_entities.within[10]>


    #filters out the directly impacted entities if any exist
    - foreach <[near_entities]>:
        - define check <[value]>
        - if <[directhit]>:
            - foreach <[direct_entities]>:
                - if <[value]> == <[check]>:
                    - define near_entities:<-:<[value]>

    #debug
    - narrate "<[near_entities]>"
    - narrate "-------------------------------------------------------"
    - narrate "<[direct_entities]>"


    #runs through damage_process task for each entity
    - if <[direct_entities]> != null:
        - foreach <[direct_entities]>:
            - narrate <[loop_index]>
            - define entityB:<[value]>
            - define is_near:false
            - define is_direct:true
            - burn <[value]> duration:<[burnbonus]>s
            - narrate "<&4><&l>You are burnt horrendously!" targets:<[value]>
            - inject damage_process
    - if !<[near_entities].is_empty>:
        - foreach <[near_entities]>:
            - narrate <[loop_index]>
            - define entityB:<[value]>
            - define is_direct:false
            - define is_near:true
            - burn <[value]> duration:<[burntime]>s
            - narrate "<&6><&l>Fire swells your surroundings!" targets:<[value]>
            - inject damage_process
    - stop