Если вы хотите поставить запрет на ношение оружия или предметов (к примеру Дестр с луком) Вы можете юзать этот скрипт.
Вы должны вставить в network/clientpackets/UseItem.java следующие строки:
Код
f (item.isEquipable())
{
if (activeChar.isDisarmed())
return;
if (!((L2Equip) item.getItem()).allowEquip(activeChar))
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.NO_CONDITION_TO_EQUIP));
return;
}
//Begining the script
+ if (activeChar.getClassId().getId() == 88)
+ {
+ if (item.getItemType() == L2ArmorType.MAGIC)
+ {
+ activeChar.sendPacket(new +SystemMessage(SystemMessageId.NO_CONDITION_TO_EQUIP));
+ return;
+ }
+ }
К примеру Глад и Роба Армор.
Если вы хотите зделать это с каким то оружием то поменяйте эту строку
Код
if (item.getItemType() == L2ArmorType.MAGIC)
на
Код
if (item.getItemType() == L2WeaponType.DAGGER)
the available class-ids and item types are listed below.
Что бы избежать юзанья бага с саб классом я использую этот скрип что бы обезвредить всё оружие и доспехи с заменой класса.
model/actor/instance/L2PcInstance.java
Код
/**
* Changes the character's class based on the given class index.
* <BR><BR>
* An index of zero specifies the character's original (base) class,
* while indexes 1-3 specifies the character's sub-classes respectively.
*
*
@param classIndex
*/
public boolean setActiveClass(int classIndex)
{
+ L2ItemInstance chest = getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST);
+ if (chest != null)
+ {
+
+ L2ItemInstance[] unequipped = +getInventory().unEquipItemInBodySlotAndRecord(chest.getItem().getBodyPart());
+ InventoryUpdate iu = new InventoryUpdate();
+ for (L2ItemInstance element : unequipped)
+ iu.addModifiedItem(element);
+ sendPacket(iu);
+
+ }
+
+ L2ItemInstance head = getInventory().getPaperdollItem(Inventory.PAPERDOLL_HEAD);
+ if (head != null)
+ {
+
+ L2ItemInstance[] unequipped = +getInventory().unEquipItemInBodySlotAndRecord(head.getItem().getBodyPart());
+ InventoryUpdate iu = new InventoryUpdate();
+ for (L2ItemInstance element : unequipped)
+ iu.addModifiedItem(element);
+ sendPacket(iu);
+
+ }
+
+ L2ItemInstance gloves = getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES);
+ if (gloves != null)
+ {
+
+ L2ItemInstance[] unequipped = +getInventory().unEquipItemInBodySlotAndRecord(gloves.getItem().getBodyPart());
+ InventoryUpdate iu = new InventoryUpdate();
+ for (L2ItemInstance element : unequipped)
+ iu.addModifiedItem(element);
+ sendPacket(iu);
+
+ }
+
+ L2ItemInstance feet = getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET);
+ if (feet != null)
+ {
+
+ L2ItemInstance[] unequipped = +getInventory().unEquipItemInBodySlotAndRecord(feet.getItem().getBodyPart());
+ InventoryUpdate iu = new InventoryUpdate();
+ for (L2ItemInstance element : unequipped)
+ iu.addModifiedItem(element);
+ sendPacket(iu);
+
+ }
+
+ L2ItemInstance legs = getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS);
+ if (legs != null)
+ {
+
+ L2ItemInstance[] unequipped = +getInventory().unEquipItemInBodySlotAndRecord(legs.getItem().getBodyPart());
+ InventoryUpdate iu = new InventoryUpdate();
+ for (L2ItemInstance element : unequipped)
+ iu.addModifiedItem(element);
+ sendPacket(iu);
+
+ }
+
+ L2ItemInstance rhand = getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
+ if (rhand != null)
+ {
+
+ L2ItemInstance[] unequipped = +getInventory().unEquipItemInBodySlotAndRecord(rhand.getItem().getBodyPart());
+ InventoryUpdate iu = new InventoryUpdate();
+ for (L2ItemInstance element : unequipped)
+ iu.addModifiedItem(element);
+ sendPacket(iu);
+
+ }
+
+ L2ItemInstance lhand = getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND);
+ if (lhand != null)
+ {
+
+ L2ItemInstance[] unequipped = +getInventory().unEquipItemInBodySlotAndRecord(lhand.getItem().getBodyPart());
+ InventoryUpdate iu = new InventoryUpdate();
+ for (L2ItemInstance element : unequipped)
+ iu.addModifiedItem(element);
+ sendPacket(iu);
+
+ }
Что бы вам было проще:
Class ID-s: Item types
HUMANS
-- 0=Human Fighter | 1=Warrior | 2=Gladiator | 3=Warlord | 4=Human Knight
-- 5=Paladin | 6=Dark Avenger | 7=Rogue | 8=Treasure Hunter | 9=Hawkeye
-- 10=Human Mystic | 11=Wizard | 12=Sorcerer/ss | 13=Necromancer | 14=Warlock
-- 15=Cleric | 16=Bishop | 17=Prophet
-- ELVES
-- 18=Elven Fighter | 19=Elven Knight | 20=Temple Knight | 21=Swordsinger | 22=Elven Scout
-- 23=Plainswalker | 24=Silver Ranger | 25=Elven Mystic | 26=Elven Wizard | 27=Spellsinger
-- 28=Elemental Summoner | 29=Elven Oracle | 30=Elven Elder
-- DARK ELVES
-- 31=Dark Fighter | 32=Palus Knight | 33=Shillien Knight | 34=Bladedancer | 35=Assassin
-- 36=Abyss Walker | 37=Phantom Ranger | 38=Dark Mystic | 39=Dark Wizard | 40=Spellhowler
-- 41=Phantom Summoner | 42=Shillien Oracle | 43=Shillien Elder
-- ORCS
-- 44=Orc Fighter | 45=Orc Raider | 46=Destroyer | 47=Monk | 48=Tyrant
-- 49=Orc Mystic | 50=Orc Shaman | 51=Overlord | 52=Warcryer
-- DWARVES
-- 53=Dwarven Fighter | 54=Scavenger | 55=Bounty Hunter | 56=Artisan | 57=Warsmith
-- HUMANS 3rd Professions
-- 88=Duelist | 89=Dreadnought | 90=Phoenix Knight | 91=Hell Knight | 92=Sagittarius
-- 93=Adventurer | 94=Archmage | 95=Soultaker | 96=Arcana Lord | 97=Cardinal
-- 98=Hierophant
-- ELVES 3rd Professions
-- 99=Evas Templar | 100=Sword Muse | 101=Wind Rider | 102=Moonlight Sentinel
-- 103=Mystic Muse | 104=Elemental Master | 105=Evas Saint
-- DARK ELVES 3rd Professions
-- 106=Shillien Templar | 107=Spectral Dancer | 108=Ghost Hunter | 109=Ghost Sentinel
-- 110=Storm Screamer | 111=Spectral Master | 112=Shillien Saint
-- ORCS 3rd Professions
-- 113=Titan | 114=Grand Khavatari
-- 115=Dominator | 116=Doomcryer
-- DWARVES 3rd Professions
-- 117=Fortune Seeker | 118=Maestro
-- KAMAELS
-- 123=Male Soldier | 124=Female Soldier | 125=Trooper | 126=Warder
-- 127=Berserker | 128=Male Soul Breaker | 129=Female Soul Breaker | 130=Arbalester
-- 131=Doombringer | 132=Male Soul Hound | 133=Female Soul Hound | 134=Trickster
-- 135=Inspector | 136=Judicator -Weapons-
NONE (Shield)
SWORD
BLUNT
DAGGER
BOW
POLE
ETC
FIST
DUAL
DUALFIST
BIGSWORD (Two Handed Swords)
PET
ROD
BIGBLUNT (Two handed blunt)
ANCIENT_SWORD
CROSSBOW
RAPIER
-Armors-
HEAVY
LIGHT
MAGIC
Тестилось на L2JFree.
© BrainFucker - Взято с АЧ