Здравствуйте уважаемые форумчане! У меня к вам важный вопрос:
Как сделать итемы бафа? Суть: При нажатии на итем чар начинает кастовать скилл(баф, в моём случае) , тоесть этот итем работает как свиток, НО, мне нужно сделать такие итемы с разными бафами, и чтобы при нажатии, итем не удалялся(это, я так понимаю, делается в исходниках). Вот код из исходников :
case 3926: // Scroll of Guidance XML:2050
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2050, 1, 1, 0));
useScroll(activeChar, 2050, 1);
break;
case 3927: // Scroll of Death Whipser XML:2051
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2051, 1, 1, 0));
useScroll(activeChar, 2051, 1);
break;
case 3928: // Scroll of Focus XML:2052
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2052, 1, 1, 0));
useScroll(activeChar, 2052, 1);
break;
case 3929: // Scroll of Greater Acumen XML:2053
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2053, 1, 1, 0));
useScroll(activeChar, 2053, 1);
break;
case 3930: // Scroll of Haste XML:2054
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2054, 1, 1, 0));
useScroll(activeChar, 2054, 1);
break;
case 3931: // Scroll of Agility XML:2055
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2055, 1, 1, 0));
useScroll(activeChar, 2055, 1);
break;
case 3932: // Scroll of Mystic Enpower XML:2056
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2056, 1, 1, 0));
useScroll(activeChar, 2056, 1);
break;
case 3933: // Scroll of Might XML:2057
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2057, 1, 1, 0));
useScroll(activeChar, 2057, 1);
break;
case 3934: // Scroll of Wind Walk XML:2058
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2058, 1, 1, 0));
useScroll(activeChar, 2058, 1);
break;
case 3935: // Scroll of Shield XML:2059
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2059, 1, 1, 0));
useScroll(activeChar, 2059, 1);
break;
case 4218: // Scroll of Mana Regeneration XML:2064
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2064, 1, 1, 0));
useScroll(activeChar, 2064, 1);
break;
case 5593: // SP Scroll Low Grade XML:2167
activeChar.sendPacket(new MagicSkillUser(playable, playable, 2167, 1, 1, 0));
activeChar.broadcastPacket(new MagicSkillUser(playable, playable, 2167, 1, 1, 0));
activeChar.addExpAndSp(0, 500);
break;
case 5594: // SP Scroll Medium Grade XML:2167
activeChar.sendPacket(new MagicSkillUser(playable, playable, 2167, 1, 1, 0));
activeChar.broadcastPacket(new MagicSkillUser(playable, playable, 2167, 1, 1, 0));
activeChar.addExpAndSp(0, 5000);
break;
case 5595: // SP Scroll High Grade XML:2167
activeChar.sendPacket(new MagicSkillUser(playable, playable, 2167, 1, 1, 0));
activeChar.broadcastPacket(new MagicSkillUser(playable, playable, 2167, 1, 1, 0));
activeChar.addExpAndSp(0, 100000);
break;
case 6037: // Scroll of Waking XML:2170
activeChar.broadcastPacket(new MagicSkillUser(playable, playable, 2170, 1, 1, 0));
useScroll(activeChar, 2170, 1);
break;
case 9146: // Scroll of Guidance - For Event XML:2050
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2050, 1, 1, 0));
useScroll(activeChar, 2050, 1);
break;
case 9147: // Scroll of Death Whipser - For Event XML:2051
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2051, 1, 1, 0));
useScroll(activeChar, 2051, 1);
break;
case 9148: // Scroll of Focus - For Event XML:2052
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2052, 1, 1, 0));
useScroll(activeChar, 2052, 1);
break;
case 9149: // Scroll of Acumen - For Event XML:2053
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2053, 1, 1, 0));
useScroll(activeChar, 2053, 1);
break;
case 9150: // Scroll of Haste - For Event XML:2054
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2054, 1, 1, 0));
useScroll(activeChar, 2054, 1);
break;
case 9151: // Scroll of Agility - For Event XML:2055
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2055, 1, 1, 0));
useScroll(activeChar, 2055, 1);
break;
case 9152: // Scroll of Enpower - For Event XML:2056
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2056, 1, 1, 0));
useScroll(activeChar, 2056, 1);
break;
case 9153: // Scroll of Might - For Event XML:2057
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2057, 1, 1, 0));
useScroll(activeChar, 2057, 1);
break;
case 9154: // Scroll of Wind Walk - For Event XML:2058
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2058, 1, 1, 0));
useScroll(activeChar, 2058, 1);
break;
case 9155: // Scroll of Shield - For Event XML:2059
activeChar.broadcastPacket(new MagicSkillUser(playable, activeChar, 2059, 1, 1, 0));
useScroll(activeChar, 2059, 1);
break;
default:
break;
}
activeChar = null;
}
public void useScroll(L2PcInstance activeChar, int magicId, int level)
{
L2Skill skill = SkillTable.getInstance().getInfo(magicId, level);
if(skill != null)
{
activeChar.doCast(skill);
}
}