Skocz do zawartości
  • 0

Efekt protection


lizz0r

Pytanie

16 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
on damage:
  set {_EPF} to 0
  loop 4 times:
    lore of victim's helmet is "&aProtection %loop-number%":
      add loop-number to {_EPF}
    lore of victim's leggings is "&aProtection %loop-number%":
      add loop-number to {_EPF}
    lore of victim's chestplate is "&aProtection %loop-number%":
      add loop-number to {_EPF}
    lore of victim's boots is "&aProtection %loop-number%":
      add loop-number to {_EPF}
    damage cause is fall:
      lore of victim's boots is "&aFeather Falling %loop-number%":
        add loop-number to {_EPF}
  set damage to damage * (1 - {_EPF}/25)


  

Odnośnik do komentarza
https://skript.pl/temat/18012-efekt-protection/#findComment-123073
Udostępnij na innych stronach

  • 0

@PoweredDragon Mogłbyś mi zrobić przykład na 2 itemy? Hełm o nazwie "Hełm" z lore "Obrona: 1" daje obrone 1,  klata "Klata" z lore "Obrona: 20" daje obrone 20 resztę ogarnę sam. ( oczywiście itemy nie mają się świecić ) 
 

Odnośnik do komentarza
https://skript.pl/temat/18012-efekt-protection/#findComment-123086
Udostępnij na innych stronach

  • 0

Zrobiłem ogólnie.

Jeśli całym opisem przedmiotu jest Obrona 1 to przedmiot daje obronę 1, jeśli jest 2 to daje 2, i tak do 4
Jeśli chcesz więcej, to musisz mi powiedzieć, będę musiał to zmeinić

Odnośnik do komentarza
https://skript.pl/temat/18012-efekt-protection/#findComment-123091
Udostępnij na innych stronach

  • 0

@PoweredDragon Zrobiłem takie coś i nie działa, dobrze zrobiłem ?

on damage:
  set {_EPF} to 0
  loop 4 times:
    lore of victim's helmet is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's leggings is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's chestplate is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's boots is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
  set damage to damage * (1 - {_EPF}/25)
command /helm:
	trigger:
		give diamond helmet named "Elo" with lore "&4Obrona 18" to player

 

Odnośnik do komentarza
https://skript.pl/temat/18012-efekt-protection/#findComment-123100
Udostępnij na innych stronach

  • 0

Tak, dobrze zrobiłeś. Ten hełm powinien działać jak hełm z prot 18 :) Tylko trzeba lekko zmodyfikować przelicznik, bo prot 18 nie jest uwzględniony w skrypcie pierwotnym

on damage:
  set {_EPF} to 0
  loop 20 times:
    lore of victim's helmet is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's leggings is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's chestplate is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's boots is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
  set damage to damage * (1 - {_EPF}/100)

 

Odnośnik do komentarza
https://skript.pl/temat/18012-efekt-protection/#findComment-123261
Udostępnij na innych stronach

  • 0
on damage:
  set {_EPF} to 0
  loop 20 times:
    lore of victim's helmet is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's leggings is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's chestplate is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's boots is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    {_EPF} < 20:
      set damage to damage * (1 - {_EPF}/25)
      stop
    {_EPF} < 40:
      set damage to damage * (1 - {_EPF}/50)
      stop
    {_EPF} < 60:
      set damage to damage * (1 - {_EPF}/75)
      stop
    {_EPF} < 80:
      set damage to damage * (1 - {_EPF}/100)
      stop

Teraz spróbuj

Odnośnik do komentarza
https://skript.pl/temat/18012-efekt-protection/#findComment-123315
Udostępnij na innych stronach

  • 0

Wszedłem na wiki, żeby sprawdzić przelicznik; wynika z tego, że:

Using this method, a player could give themselves, for example, 
a full set of diamond armor with a Protection V enchantment on every piece. 
Following the algorithm above, we find that, since Protection V has an EPF of 5, 
the armor will exactly reach the maximum EPF of 20 for all types of damage. 
Any higher Protection enchantments could be used to allow the cap to be reached with only one enchantment, 
rather than having a full set of enchanted armor, but would be wasted if all pieces shared the same level enchantment.

Czyli, że jeśli nakładamy na cały set proection > 5, to nic to nie zmieni, bo i tak już osiągniemy max redukcji obrażeń :v

 

Czyli ten skrypt:

on damage:
  set {_EPF} to 0
  loop 20 times:
    lore of victim's helmet is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's leggings is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's chestplate is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's boots is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    {_EPF} <= 20:
      set damage to damage*(1 - {_EPF}/25)
      stop
     set damage to damage*0.2

 

Odnośnik do komentarza
https://skript.pl/temat/18012-efekt-protection/#findComment-123335
Udostępnij na innych stronach

  • 0

Dać radę da, gdzieś jest błąd, którego w kodzie nie ma k_k

 

on damage:
  set {_EPF} to 0
  loop 20 times:
    lore of victim's helmet is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's leggings is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's chestplate is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's boots is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    loop 4 times:
      set {_Q::%loop-number%} to {_EPF}/25
      set {_Q::%loop-number%} to {_Q::%loop-number%}/loop-number
      set {_Q::%loop-number%} to 1-{_Q::%loop-number%}
      set {_eEPF} to 20*loop-number
    {_EPF} < {_eEPF}:
      set damage to damage * {_Q::%loop-number%}
      stop

 

Odnośnik do komentarza
https://skript.pl/temat/18012-efekt-protection/#findComment-123358
Udostępnij na innych stronach

  • 0
on damage:
  set {_EPF} to 0
  loop 20 times:
    lore of victim's helmet is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's leggings is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's chestplate is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
    lore of victim's boots is "&4Obrona %loop-number%":
      add loop-number to {_EPF}
  loop 4 times:
    set {_Q::%loop-number%} to {_EPF}/25
    set {_Q::%loop-number%} to {_Q::%loop-number%}/loop-number
    set {_Q::%loop-number%} to 1-{_Q::%loop-number%}
    set {_eEPF} to 20*loop-number
    {_EPF} < {_eEPF}:
      set damage to damage * {_Q::%loop-number%}
      stop

 

Odnośnik do komentarza
https://skript.pl/temat/18012-efekt-protection/#findComment-123426
Udostępnij na innych stronach

Nieaktywny
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...