Custom event team prohibitions.
Contributed by Trance.
This commit is contained in:
		| @@ -971,6 +971,12 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe | ||||
| 					sendPacket(ActionFailed.STATIC_PACKET); | ||||
| 					return; | ||||
| 				} | ||||
| 				// Events. | ||||
| 				else if (getActingPlayer().isOnCustomEvent() && target.isPlayable() && (getActingPlayer().getTeam() == target.getActingPlayer().getTeam())) | ||||
| 				{ | ||||
| 					sendPacket(ActionFailed.STATIC_PACKET); | ||||
| 					return; | ||||
| 				} | ||||
| 			} | ||||
| 			else if (isInsidePeaceZone(this, target)) | ||||
| 			{ | ||||
|   | ||||
| @@ -1080,6 +1080,25 @@ public class SkillCaster implements Runnable | ||||
| 				caster.sendPacket(sm); | ||||
| 				return false; | ||||
| 			} | ||||
| 			 | ||||
| 			// Events. | ||||
| 			if (player.isOnCustomEvent()) | ||||
| 			{ | ||||
| 				if (skill.hasEffectType(EffectType.TELEPORT)) // Disable teleport skills. | ||||
| 				{ | ||||
| 					player.sendMessage("You cannot use " + skill.getName() + " while attending an event."); | ||||
| 					return false; | ||||
| 				} | ||||
| 				 | ||||
| 				if (skill.isBad()) | ||||
| 				{ | ||||
| 					final WorldObject target = player.getTarget(); | ||||
| 					if ((target != null) && target.isPlayable() && (player.getTeam() == target.getActingPlayer().getTeam())) | ||||
| 					{ | ||||
| 						return false; | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		return true; | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDevelopment
					MobiusDevelopment