Aller au contenu

Messages recommandés

Posté(e)

Bonjour,

On a voulu établir un système d'XP et de LVL, cependant on se demande si une optimisation n'est pas possible dans notre code. Nous sommes débutants, si vous avez des suggestions nous sommes preneurs.

 

# Spé bucheron


#Reset XP Bucheron

command /breset [<player>]:
	permission: r.bucheron
	trigger:
		if arg 1 is not set:
			if {metier::%uuid of player%} is not 1:
				send "&7[&cERREUR&7] &cTu n'es pas bucheron."
			else:
				clear {xpbucheron::%uuid of player%}
				set {lvlbucheron::%uuid of player%} to 1
				send "&7[&aOK&7] &aTon XP à été reset."
		else:
			if {metier::%uuid of arg 1%} is not 1:
				send "&7[&cERREUR&7] &6%arg-1% &cne possède pas de métier Bucheron."
			if {metier::%uuid of arg 1%} is 1:
				clear {xpbucheron::%uuid of arg 1%}
				set {lvlbucheron::%uuid of arg 1%} to 1
				send "&7[&aOK&7] &aReset effectué du métier Bucheron sur : &6%arg-1%&a."

#LVL & XP
				
command /blvl:
	trigger:
		if {metier::%uuid of player%} = 1:
			if {lvlbucheron::%uuid of player%} = 1:
				message "&a&m===================="
				message ""
				message "    &aTu es niveau &6%{lvlbucheron::%uuid of player%}% &a!"
				message "&aTu as %{xpbucheron::%uuid of player%}%/XXXX XP !"
				message ""
				message "&a&m===================="
			if {lvlbucheron::%uuid of player%} = 2:
				message "&a&m===================="
				message ""
				message "    &aTu es niveau &6%{lvlbucheron::%uuid of player%}% &a!"
				message "&aTu as %{xpbucheron::%uuid of player%}%/XXXX XP !"
				message ""
				message "&a&m===================="
			if {lvlbucheron::%uuid of player%} = 3:
				message "&a&m===================="
				message ""
				message "    &aTu es niveau &6%{lvlbucheron::%uuid of player%}% &a!"
				message "&aTu as %{xpbucheron::%uuid of player%}%/XXXX XP !"
				message ""
				message "&a&m===================="
			if {lvlbucheron::%uuid of player%} = 4:
				message "&a&m===================="
				message ""
				message "    &aTu es niveau &6%{lvlbucheron::%uuid of player%}% &a!"
				message "&aTu as %{xpbucheron::%uuid of player%}%/XXXX XP !"
				message ""
				message "&a&m===================="
			if {lvlbucheron::%uuid of player%} = 5:
				message "&a&m===================="
				message ""
				message "    &aTu es niveau &6%{lvlbucheron::%uuid of player%}% &a!"
				message "&aTu as %{xpbucheron::%uuid of player%}%/XXXX XP !"
				message ""
				message "&a&m===================="
			if {lvlbucheron::%uuid of player%} = 6:
				message "&a&m===================="
				message ""
				message "    &aTu es niveau &6%{lvlbucheron::%uuid of player%}% &a!"
				message "&aTu as %{xpbucheron::%uuid of player%}%/XXXX XP !"
				message ""
				message "&a&m===================="
			if {lvlbucheron::%uuid of player%} = 7:
				message "&a&m===================="
				message ""
				message "    &aTu es niveau &6%{lvlbucheron::%uuid of player%}% &a!"
				message "&aTu as %{xpbucheron::%uuid of player%}%/XXXX XP !"
				message ""
				message "&a&m===================="
			if {lvlbucheron::%uuid of player%} = 8:
				message "&a&m===================="
				message ""
				message "    &aTu es niveau &6%{lvlbucheron::%uuid of player%}% &a!"
				message "&aTu as %{xpbucheron::%uuid of player%}%/XXXX XP !"
				message ""
				message "&a&m===================="
			if {lvlbucheron::%uuid of player%} = 9:
				message "&a&m===================="
				message ""
				message "    &aTu es niveau &6%{lvlbucheron::%uuid of player%}% &a!"
				message "&aTu as %{xpbucheron::%uuid of player%}%/XXXX XP !"
				message ""
				message "&a&m===================="
			if {lvlbucheron::%uuid of player%} = 10:
				message "&a&m===================="
				message ""
				message "    &aTu es niveau &6%{lvlbucheron::%uuid of player%}% &a!"
				message "&aTu n'as plus besoin d'XP !"
				message ""
				message "&a&m===================="
		if {metier::%uuid of player%} is not set:
			message "&7[&cERREUR&7] &cTu n'es pas bucheron."

# Système de gain d'XP

on break of any log, acacia log or dark oak log:
	if {lvlbucheron::%uuid of player%} = 10:
		stop
	if {metier::%uuid of player%} = 1:
		add 1 to {xpbucheron::%uuid of player%}
		if {lvlbucheron::%uuid of player%} = 1:
			if {xpbucheron::%uuid of player%} = 1:
				add 1 to {lvlbucheron::%uuid of player%}
				delete {xpbucheron::%uuid of player%}
				message "&7[&6LEVEL-UP&7] &aTu es dorénavant niveau &6%{lvlbucheron::%uuid of player%}% &ade ton métier !"
		if {lvlbucheron::%uuid of player%} = 2:
			if {xpbucheron::%uuid of player%} = 1:
				add 1 to {lvlbucheron::%uuid of player%}
				delete {xpbucheron::%uuid of player%}
				message "&7[&6LEVEL-UP&7] &aTu es dorénavant niveau &6%{lvlbucheron::%uuid of player%}% &ade ton métier !"
		if {lvlbucheron::%uuid of player%} = 3:
			if {xpbucheron::%uuid of player%} = 1:
				add 1 to {lvlbucheron::%uuid of player%}
				delete {xpbucheron::%uuid of player%}
				message "&7[&6LEVEL-UP&7] &aTu es dorénavant niveau &6%{lvlbucheron::%uuid of player%}% &ade ton métier !"
		if {lvlbucheron::%uuid of player%} = 4:
			if {xpbucheron::%uuid of player%} = 1:
				add 1 to {lvlbucheron::%uuid of player%}
				delete {xpbucheron::%uuid of player%}
				message "&7[&6LEVEL-UP&7] &aTu es dorénavant niveau &6%{lvlbucheron::%uuid of player%}% &ade ton métier !"
		if {lvlbucheron::%uuid of player%} = 5:
			if {xpbucheron::%uuid of player%} = 1:
				add 1 to {lvlbucheron::%uuid of player%}
				delete {xpbucheron::%uuid of player%}
				message "&7[&6LEVEL-UP&7] &aTu es dorénavant niveau &6%{lvlbucheron::%uuid of player%}% &ade ton métier !"
		if {lvlbucheron::%uuid of player%} = 6:
			if {xpbucheron::%uuid of player%} = 1:
				add 1 to {lvlbucheron::%uuid of player%}
				delete {xpbucheron::%uuid of player%}
				message "&7[&6LEVEL-UP&7] &aTu es dorénavant niveau &6%{lvlbucheron::%uuid of player%}% &ade ton métier !"
		if {lvlbucheron::%uuid of player%} = 7:
			if {xpbucheron::%uuid of player%} = 1:
				add 1 to {lvlbucheron::%uuid of player%}
				delete {xpbucheron::%uuid of player%}
				message "&7[&6LEVEL-UP&7] &aTu es dorénavant niveau &6%{lvlbucheron::%uuid of player%}% &ade ton métier !"
		if {lvlbucheron::%uuid of player%} = 8:
			if {xpbucheron::%uuid of player%} = 1:
				add 1 to {lvlbucheron::%uuid of player%}
				delete {xpbucheron::%uuid of player%}
				message "&7[&6LEVEL-UP&7] &aTu es dorénavant niveau &6%{lvlbucheron::%uuid of player%}% &ade ton métier !"
		if {lvlbucheron::%uuid of player%} = 9:
			if {xpbucheron::%uuid of player%} = 1:
				add 1 to {lvlbucheron::%uuid of player%}
				delete {xpbucheron::%uuid of player%}
				message "&7[&6LEVEL-UP&7] &aTu es dorénavant niveau &6%{lvlbucheron::%uuid of player%}% &ade ton métier ! Niveau maximum atteint !"

 

Le code ici est juste pour le métier de bucheron, les XP nécessaires pour augmenter de LVL ne sont pas encore définis, c'est juste une ébauche.
Nous sommes preneur de toutes suggestions et de conseils !

Merci beaucoup 🙂

Créer un compte ou se connecter pour commenter

Vous devez être membre afin de pouvoir déposer un commentaire

Créer un compte

Créez un compte sur notre communauté. C’est facile !

Créer un nouveau compte

Se connecter

Vous avez déjà un compte ? Connectez-vous ici.

Connectez-vous maintenant
×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.