Date: 2019/08/09 11:56:30 UTC-07:00
Type: Denizen Script
lightning_spell:
type: world
events:
on player right clicks with lightning_spell_wand:
- run lightning_spell_task instantly
lightning_spell_task:
type: task
script:
- define cursor_aim:<player.location.points_between[<player.location.cursor_on[25].ignore[water|flowing_water|grass]>]>
- foreach <[cursor_aim]> as:originparticle:
- playeffect effect:SPELL_WITCH at:<[originparticle]> quantity:5 visibility:35
- define currentlocation:<[originparticle]>
- wait 0.001s
- foreach <[originparticle].find.living_entities.within[15]> as:foundentity:
- foreach <[foundentity]> as:singleentity:
- if <[singleentity].has_flag[lightning_spell_hit]> {
} else {
- foreach <def[currentlocation].points_between[<[singleentity].location>]> :
- playeffect effect:SPELL_WITCH at:<[spreadlocation]> visibility:35
- hurt 5 <[singleentity]>
- flag <[singleentity]> lightning_spell_hit:1 duration:5s
}