bind(player_interact, null, array(button: right, item: data_values(book)), @event, if(!has_value('mana.'.player())) { store_value('mana.'.player(), 100) } @spell = get_value('active.spell.'.player()); @mana = get_value('mana.'.player()); @mana_cost = get_value('mana.cost.'.player()); store_value('mana.'.player(), integer(@mana - @mana_cost)) play_sound(ploc(), array(sound: 'FIREWORK_LAUNCH')) @multiplier = get_value('multiplier.'.player()) @arrow = shoot_projectile(player(), get_value('entity.'.player())) @velocity = entity_velocity(@arrow) set_entity_velocity(@arrow, array(@velocity['x'] * @multiplier, @velocity['y'] * @multiplier, @velocity['z'] * @multiplier)) @book_meta = array(display: colorize(concat('&dSpell Book &7| &dMana: ', @mana, '%')), lore: array(colorize('&7---'), colorize(concat('&dActive Spell: &7', @spell)), colorize(concat('&dSpell Damage: &7', @multiplier)), colorize(concat('&dMana Cost: &7', @mana_cost)))); set_pinv(array(0: array(data: 0, meta: @book_meta, qty: 1, type: 340))) set_pexp(player(), @mana) if(@mana <= 0) { @mana = 0; for(assign(@i, 100), @mana <= 100, @mana++) { @book_meta = array(display: colorize(concat('&dSpell Book &7| &dMana: ', @mana, '%')), lore: array(colorize('&7---'), colorize(concat('&dActive Spell: &7', @spell)), colorize(concat('&dSpell Damage: &7', @multiplier)), colorize(concat('&dMana Cost: &7', @mana_cost)))); queue_push(closure( play_sound(ploc(), array(sound: 'ORB_PICKUP', volume: 0.05)) set_pinv(array(0: array(data: 0, meta: @book_meta, qty: 1, type: 340))) set_pexp(player(), @mana) cancel(@event) ), 'restore_mana') queue_delay(50, 'restore_mana') } store_value('mana.'.player(), 100) } ) bind(player_interact, null, array(button: right, item: data_values(nether_star)), @event, if(!has_value('active.spell.'.player())) { store_value('active.spell.'.player(), 'Shoot Arrow') } @spell = get_value('active.spell.'.player()); @meta = array(display: colorize(concat('&dChange Active Spell'))) set_pinv(array(8: array(data: 0, meta: @meta, qty: 1, type: 399))) if(@spell == 'Shoot Arrow') { @spell = 'Shoot Fireball'; store_value('active.spell.'.player(), @spell) msg(colorize(concat('&dYour active spell is now:&7 ', @spell))) store_value('multiplier.'.player(), 2) store_value('entity.'.player(), 'SMALL_FIREBALL') store_value('mana.cost.'.player(), 10) } else if(@spell == 'Shoot Fireball') { @spell = 'Blink'; store_value('active.spell.'.player(), @spell) msg(colorize(concat('&dYour active spell is now:&7 ', @spell))) store_value('multiplier.'.player(), 2) store_value('entity.'.player(), 'ENDER_PEARL') store_value('mana.cost.'.player(), 25) } else if (@spell == 'Blink') { @spell = 'Shoot Arrow'; store_value('active.spell.'.player(), @spell) msg(colorize(concat('&dYour active spell is now:&7 ', @spell))) store_value('multiplier.'.player(), 1) store_value('entity.'.player(), 'ARROW') store_value('mana.cost.'.player(), 5) } ) bind(item_pickup, null, null, @event, cancel(@event) ) bind(player_join, null, null, @event, store_value('multiplier.'.player(), 1) store_value('entity.'.player(), 'ARROW') store_value('mana.cost.'.player(), 5) @gems = get_value('gems.'player()) set_pinv(array( 0: array(data: 0, meta: array(display: colorize(concat('&dSpell Book &7| &dMana: ', @mana, '%')), lore: array(colorize('&7---'), colorize(concat('&dActive Spell: &7', @spell)), colorize(concat('&dSpell Damage: &7', @multiplier)))), qty: 1, type: 340), 8: array(data: 0, meta: array(display: colorize(concat('&dChange Active Spell'))), qty: 1, type: 399) )) )