elBukkit / MagicPlugin

A Bukkit plugin for spells, wands and other magic
http://mine.elmakers.com
MIT License
247 stars 147 forks source link

Not issue. Just Random TIPs how to make magic more... advanced #1178

Open vajuvung opened 1 year ago

vajuvung commented 1 year ago

this is the small list to completly random tips for using Magic!

I hope you enjoy it!

  1. Magic have something like check world?

Well... no but you can try create new global region like global

about global region in specific world https://worldguard.enginehub.org/en/latest/regions/global-region/

then you can use check region

  1. can i have spells that can scale with my attack damage, exp, etc...

Yes you can!

Grab this example

missile_with_scaling_other_plugins:
  name: lol
  icon: stick
  actions:
    cast:
    - class: CustomProjectile
      actions:
      - class: UpdateParameters
        actions:
        - class: Damage
  effects:
    cast:
    - sound: magic.zap
    hit:
    - location: target
      effectlib:
        class: Sphere
    tick:
    - location: target
      particle: redstone
  parameters:
    range: "90 + knockback * 5"
    velocity: 20
    damage: "level + sharpness + attack_damage - target_armor * 0.5"
    cooldown: "1000 * (1 - sweeping / 10)"
  costs:
    mana: 15
don't forget to put ``UpdateParameters`` before damage!

Check placeholder in wiki if you want put something diffrent: https://github.com/elBukkit/MagicPlugin/wiki/Placeholders

3. is possible to make friendly mob that can cast spell into enemy?

Yes!
    trojzab:
  icon: gold_nugget{CustomModelData:10}
  icon_disabled: barrier
  quick_cast: true
  requires: LibsDisguises
  hidden: true
  locked: true
  mode: hidden
  ownable: true
  actions:
    cast:
    - class: Command
      command: mmobuff give @pn summon_trojzab 60
      console: true
    - class: SpawnEntity
      owned: true
      entity_attributes:
        generic_attack_damage: "attack_damage * 1"
      brain:
        goals:
        - type: trigger
          trigger: attack
          priority: 1
          goals:
            - melee_attack
        - type: follow_owner
          priority: 2
        - type: random_stroll
          distance: 12
          priority: 3
        targets:
          - MAGIC_OWNER_HURT_TARGET
          - MAGIC_OWNER_HURT_BY_TARGET
      triggers:
        attack:
          cast:
            missile: 20   
  parameters:
    target: self
    health: "health_max * 5"
    radius: 2
    helmet: iron_helmet
    cooldown: 60100
    undo: 60000
    cancel_on_damage: 0.5
    type: skeleton
    name: Minion_cast
    item: bow
    disguise_target: self
as you can see your mob will cast spell named ``missile`` you can change it [and also scaling with you health but is not important]

you can check all AI type here: https://github.com/elBukkit/MagicPlugin/blob/e43d07061fd99cbbabe535cbf6f7a8936ff4f54c/CompatibilityLib/common/src/main/java/com/elmakers/mine/bukkit/mob/GoalType.java

i didn't check most of them, so if you want more than walk to enemy and shot missile, try find somethink in github

4. My mob can cast same spell as i?

Yes! this is example how your mob can do that!
    lancuch_ciemnosc_1:
    name: Łańcuch Ciemnośći
    description:  Zaszokuj cel i poprowadź łańcuch do innych pobliskich celów {Obrażenia twojej broni 125% + effekt ciemnośći}
    icon: golden_horse_armor{CustomModelData:32}
    icon_disabled: barrier
    upgrade_required_casts: 25
    actions:
        cast:
        - class: ApplyCooldown
          spells: lancuch_ciemnosc_1,lancuch_ogien_1,lancuch_piorun_1,lancuch_swiatlo_1,lancuch_trucizna_1,lancuch_wiatr_1,lancuch_woda_1,lancuch_ziemia_1
          target_caster: true
          duration: "20000 * (1 - sweeping / 20)"
        - class: Command
          console: true
        - class: CustomProjectile
          actions:
          - class: Damage
            damage: 6
            damage_type: out_of_world
          - class: Delay
          - class: AreaOfEffect
            actions:
            - class: Asynchronous
              actions:
              - class: CustomProjectile
                velocity: 150
                actions:
                - class: Repeat
                  actions:
                  - class: Electrify
                  - class: Damage
                    damage_type: out_of_world
                  - class: Delay
          - class: Electrify
          - class: Repeat
            actions:
            - class: Damage
              damage_type: out_of_world
            - class: PotionEffect
              duration: 5000
            - class: Delay
    effects:
        cast:
        -  class: EffectSingle
           sound: magic.zap
           location: origin
        -  sound: block_conduit_activate
           sound_pitch: 1.75
        projectile:
        - class: EffectSingle
          effectlib:
             class: LineEffect
             isZigZag: true
             zigZags: 2
             zigZagOffset: 0,0.05,0
             length: 10
             particles: 50
             particle: redstone
             color: "000000"
             duration: 2000
        - location: source
          effectlib:
             class: LineEffect
             isZigZag: true
             zigZags: 2
             zigZagOffset: 0,0.05,0
             length: 10
             particles: 20
             particle: squid_ink
             particle_count: 4
             particle_offset_x: 0.1
             particle_offset_y: 0.1
             particle_offset_z: 0.1
             duration: 2000
        tick:
        - particle: squid_ink
          particle_count: 2
          particle_offset_x: 0.2
          particle_offset_y: 0.2
          particle_offset_z: 0.2
          location: target
        hit:
        -  sound: entity_guardian_attack
           sound_pitch: 2
           sound_volume: 0.5
           location: target
        -  class: EffectSingle
           sound: magic.zap_crack
           sound_volume: 0.5
           location: target
           particle: fireworks_spark
           particle_count: 10
           particle_offset_x: 1
           particle_offset_y: 1
           particle_offset_z: 1
        -  sound: block_conduit_activate
           sound_pitch: 1.8
           location: target
    parameters:
        command: castp @pn lancuch_ciemnosc_minion
        tick_size: 5
        target: other
        target_self: false
        target_source: false
        range: "48 + knockback * 5"
        velocity: 100
        radius: 8
        target_count: 3
        target_types: zombie,husk,blaze,cave_spider,creeper,drowned,elder_guardian,ender_dragon,enderman,endermite,evoker,evoker_fangs,ghast,giant,guardian,illusioner,magma_cube,phantom,piglin,piglin_brute,pillager,ravager,shulker,slime,spider,strider,trident,vex,vindicator,witch,wither,wither_skeleton,wither_skull,zoglin,zombie_villager,zombified_piglin
        ignore_name: Minion
        player_damage: 1.5
        damage: "sharpness + attack_damage * 1.25 - luck * 0.5"
        nim_damage: 1
        delay: 250
        add_effects:
          damage_resistance: -1
        repeat: 4
        target_breakables: 1
        cooldown: "20000 * (1 - sweeping / 20)"
    costs:
        mana: 35

lancuch_ciemnosc_1|2:
    description: Zaszokuj cel i poprowadź łańcuch do innych pobliskich celów {Obrażenia twojej broni 135% + effekt ciemnośći}
    upgrade_required_casts: 40
    parameters:
        damage: "sharpness + attack_damage * 1.35 - luck * 0.5"
    costs:
        mana: 40

lancuch_ciemnosc_1|3:
    description: Zaszokuj cel i poprowadź łańcuch do innych pobliskich celów {Obrażenia twojej broni 145% + effekt ciemnośći}
    parameters:
        damage: "sharpness + attack_damage * 1.45 - luck * 0.5"
    costs:
        mana: 45

lancuch_ciemnosc_minion:
    actions:
        cast:
        - class: Delay
          delay: 1000
        - class: AreaOfEffect
          target_name: Minion_cast
          radius: 200
          actions:
          - class: CheckEntity
            owned: true
            owner: true
            actions:
            - class: Command
              command: castp @tuuid lancuch_ciemnosc_1
              console: true
            - class: Cast
              spell: lancuch_ciemnosc_1
              console: true
              cost_free: true
    parameters:
        target: self
        target_types: skeleton

lancuch_ciemnosc_minion_2:
    actions:
        cast:
        - class: Delay
          delay: 1000
        - class: AreaOfEffect
          target_name: Minion_cast
          radius: 200
          actions:
          - class: CheckEntity
            owned: true
            owner: true
            actions:
            - class: Command
              command: castp @tuuid lancuch_ciemnosc_1|2
              console: true
            - class: Cast
              spell: lancuch_ciemnosc_1|2
              console: true
              cost_free: true
    parameters:
        target: self
        target_types: skeleton

lancuch_ciemnosc_minion_3:
    actions:
        cast:
        - class: Delay
          delay: 1000
        - class: AreaOfEffect
          target_name: Minion_cast
          radius: 200
          actions:
          - class: CheckEntity
            owned: true
            owner: true
            actions:
            - class: Command
              command: castp @tuuid lancuch_ciemnosc_1|3
              console: true
            - class: Cast
              spell: lancuch_ciemnosc_1|3
              console: true
              cost_free: true
    parameters:
        target: self
        target_types: skeleton
    this is VERY long example but for me is worth! and if you think you can better than mine... well... send below

    i am failed at  check mob with area of effect. Just put target all entity

    don't forget to target mob that have name minion_cast. 

    5. Can i create armor that can cast spells?

    Try this
        napiersnik_czarnejmateri:
  passive: true
  triggers: damage
  actions:
    cast:
    - class: Delay
      delay: 20
    - class: Heal
      amount: 3
  parameters:
    target: self
    cooldown: 15000
napiersnik_czarnejmateri:
  name: '&fNapiersnik czarnejmateri'
  icon: leather_chestplate:#454545{3}
  version: 7
  indestructible: true
  passive: true
  spells:
  - napiersnik_czarnejmateri
  spell_inventory:
    napiersnik_czarnejmateri: 0
  item_attributes:
    generic_luck:
      value: 11
    generic_knockback_resistance:
      value: 3

As you can see if you equip armor and you get damage you will be healed. If you want diffrent effect like cast missile just replace spells in armor

  1. Can i hold 2 wand and use spell inventory?

if you want only cast spell from one wand add this allow_offhand: false. if you want cast spell with 2 wands is... complicated i lost my example but you can try double bar. When first wand have cycle mode and active secend bar then secend wand must have inventory mode.

  1. Can i make my custom effects?

again is more like cheating but if you really need it..

this is example of CUSTOM POTION:

chleb_z_dzemem:
  icon: cookie{1}
  name: '&eChleb &fz &cdzemem'
  consume_spell: eat_food
  overrides:
    feed: 3
    saturation: 1
    command: "castp @p dzem"
    dzem:
  actions:
    cast:
    - class: RemoveWand
    - class: Message
      message: '&6Effekt Odwagi AKTYWNY!'
      message_type: chat
    - class: Command
      command: mage unlock @pn lisc_czerwonyA
      console: true
    - class: Delay
      delay: 8000
    - class: Message
      message: '&6Effekt Odwagi WYCZERPANY!'
      message_type: chat
    - class: Command
      command: mage lock @pn lisc_czerwonyA
      console: true
  parameters:
    target: self
    cooldown: 30000
This example unlock class for 8 secend then lock class. So in class you can put more armor or something like that wihtout using vanilla potions... so you can stack potion

Thanks for listening
vajuvung commented 1 year ago

oof i broken the format