~/paste/13495
~/paste/13495
~/paste/13495

  1. bind(player_interact, null, array(button: right, item: data_values(book)), @event,
  2.         if(!has_value('mana.'.player())) {
  3.                 store_value('mana.'.player(), 100)
  4.                 }
  5.        
  6.        
  7.         @spell = get_value('active.spell.'.player());
  8.        
  9.         @mana = get_value('mana.'.player());
  10.  
  11.         @mana_cost = get_value('mana.cost.'.player());
  12.        
  13.         store_value('mana.'.player(), integer(@mana - @mana_cost))
  14.        
  15.         play_sound(ploc(), array(sound: 'FIREWORK_LAUNCH'))
  16.         @multiplier = get_value('multiplier.'.player())
  17.         @arrow = shoot_projectile(player(), get_value('entity.'.player()))
  18.         @velocity = entity_velocity(@arrow)
  19.         set_entity_velocity(@arrow, array(@velocity['x'] * @multiplier, @velocity['y'] * @multiplier, @velocity['z'] * @multiplier))
  20.        
  21.         @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))));
  22.         set_pinv(array(0: array(data: 0, meta: @book_meta, qty: 1, type: 340)))
  23.         set_pexp(player(), @mana)
  24.        
  25.         if(@mana <= 0) {
  26.                
  27.                 @mana = 0;
  28.                
  29.                 for(assign(@i, 100), @mana <= 100, @mana++) {
  30.                 @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))));
  31.                 queue_push(closure(
  32.                 play_sound(ploc(), array(sound: 'ORB_PICKUP', volume: 0.05))
  33.                 set_pinv(array(0: array(data: 0, meta: @book_meta, qty: 1, type: 340)))
  34.                 set_pexp(player(), @mana)
  35.                 cancel(@event) ), 'restore_mana')
  36.                
  37.                 queue_delay(50, 'restore_mana')
  38.                 }
  39.                 store_value('mana.'.player(), 100)
  40.                 }
  41.         )
  42.  
  43. bind(player_interact, null, array(button: right, item: data_values(nether_star)), @event,
  44.         if(!has_value('active.spell.'.player())) {
  45.                 store_value('active.spell.'.player(), 'Shoot Arrow')
  46.                 }
  47.  
  48.         @spell = get_value('active.spell.'.player());
  49.        
  50.         @meta = array(display: colorize(concat('&dChange Active Spell')))
  51.        
  52.         set_pinv(array(8: array(data: 0, meta: @meta, qty: 1, type: 399)))
  53.        
  54.         if(@spell == 'Shoot Arrow') {
  55.                
  56.                 @spell = 'Shoot Fireball';
  57.                 store_value('active.spell.'.player(), @spell)
  58.                 msg(colorize(concat('&dYour active spell is now:&7 ', @spell)))
  59.                
  60.                 store_value('multiplier.'.player(), 2)
  61.                 store_value('entity.'.player(), 'SMALL_FIREBALL')
  62.                 store_value('mana.cost.'.player(), 10)
  63.                
  64.                 } else if(@spell == 'Shoot Fireball') {
  65.                 @spell = 'Blink';
  66.                 store_value('active.spell.'.player(), @spell)
  67.                 msg(colorize(concat('&dYour active spell is now:&7 ', @spell)))
  68.                        
  69.                 store_value('multiplier.'.player(), 2)
  70.                 store_value('entity.'.player(), 'ENDER_PEARL')
  71.                 store_value('mana.cost.'.player(), 25)
  72.                
  73.                 } else if (@spell == 'Blink') {
  74.                
  75.                 @spell = 'Shoot Arrow';
  76.                 store_value('active.spell.'.player(), @spell)
  77.                 msg(colorize(concat('&dYour active spell is now:&7 ', @spell)))
  78.                        
  79.                 store_value('multiplier.'.player(), 1)
  80.                 store_value('entity.'.player(), 'ARROW')
  81.                 store_value('mana.cost.'.player(), 5)
  82.                
  83.                 }
  84.        
  85.         )
  86.        
  87. bind(item_pickup, null, null, @event,
  88.         cancel(@event)
  89.         )
  90.        
  91. bind(player_join, null, null, @event,
  92.         store_value('multiplier.'.player(), 1)
  93.         store_value('entity.'.player(), 'ARROW')
  94.         store_value('mana.cost.'.player(), 5)
  95.        
  96.         @gems = get_value('gems.'player())
  97.        
  98.         set_pinv(array(
  99.         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),
  100.         8: array(data: 0, meta: array(display: colorize(concat('&dChange Active Spell'))), qty: 1, type: 399)
  101.         ))
  102.         )
Language: commandhelper
Posted by Anonymous at 20 Mar 2014, 10:08:43 UTC