Рейтинг темы:
  • 0 Голос(ов) - 0 в среднем
  • 1
  • 2
  • 3
  • 4
  • 5
Бесконечные SpiritShot и SoulShots. Требуется помощь
#1
Сборка: l2jserver freya

Настройки, как я понял, менять здесь '\data\scripts\handlers\itemhandlers"

SoulShots.java и SpiritShot.java

Но что именно в них удалить я не знаю Sad


SpiritShot.java

package handlers.itemhandlers;

import com.l2jserver.gameserver.handler.IItemHandler;
import com.l2jserver.gameserver.model.L2ItemInstance;
import com.l2jserver.gameserver.model.actor.L2Playable;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse;
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
import com.l2jserver.gameserver.templates.item.L2Item;
import com.l2jserver.gameserver.templates.item.L2Weapon;
import com.l2jserver.gameserver.util.Broadcast;

/**
* This class ...
*
* @version $Revision: 1.1.2.1.2.5 $ $Date: 2005/03/27 15:30:07 $
*/

public class SpiritShot implements IItemHandler
{
/**
*
* @see com.l2jserver.gameserver.handler.IItemHandler#useItem(com.l2jserver.gameserver.model.actor.L2Playable, com.l2jserver.gameserver.model.L2ItemInstance, boolean)
*/
public synchronized void useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
{
if (!(playable instanceof L2PcInstance))
return;

L2PcInstance activeChar = (L2PcInstance) playable;
L2ItemInstance weaponInst = activeChar.getActiveWeaponInstance();
L2Weapon weaponItem = activeChar.getActiveWeaponItem();
int itemId = item.getItemId();

// Check if Spirit shot can be used
if (weaponInst == null || weaponItem.getSpiritShotCount() == 0)
{
if (!activeChar.getAutoSoulShot().contains(itemId))
activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CANNOT_USE_SPIRITSHOTS));
return;
}

// Check if Spirit shot is already active
if (weaponInst.getChargedSpiritshot() != L2ItemInstance.CHARGED_NONE)
return;

final int weaponGrade = weaponItem.getCrystalType();

boolean gradeCheck = true;

switch (weaponGrade)
{
case L2Item.CRYSTAL_NONE:
if (itemId != 5790 && itemId != 2509)
gradeCheck = false;
break;
case L2Item.CRYSTAL_D:
if (itemId != 2510 && itemId != 22077)
gradeCheck = false;
break;
case L2Item.CRYSTAL_C:
if (itemId != 2511 && itemId != 22078)
gradeCheck = false;
break;
case L2Item.CRYSTAL_B:
if (itemId != 2512 && itemId != 22079)
gradeCheck = false;
break;
case L2Item.CRYSTAL_A:
if (itemId != 2513 && itemId != 22080)
gradeCheck = false;
break;
case L2Item.CRYSTAL_S:
case L2Item.CRYSTAL_S80:
case L2Item.CRYSTAL_S84:
if (itemId != 2514 && itemId != 22081)
gradeCheck = false;
break;
}

if (!gradeCheck)
{
if (!activeChar.getAutoSoulShot().contains(itemId))
activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.SPIRITSHOTS_GRADE_MISMATCH));

return;
}

// Consume Spirit shot if player has enough of them
if (!activeChar.destroyItemWithoutTrace("Consume", item.getObjectId(), weaponItem.getSpiritShotCount(), null, false))
{
if (!activeChar.disableAutoShot(itemId))
activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOT_ENOUGH_SPIRITSHOTS));
return;
}

// Charge Spirit shot
weaponInst.setChargedSpiritshot(L2ItemInstance.CHARGED_SPIRITSHOT);
int skillId = 0;
switch (itemId)
{
case 2509:
case 5790:
skillId=2061;
break;
case 2510:
skillId=2155;
break;
case 2511:
skillId=2156;
break;
case 2512:
skillId=2157;
break;
case 2513:
skillId=2158;
break;
case 2514:
skillId=2159;
break;
case 22077:
skillId=26055;
break;
case 22078:
skillId=26056;
break;
case 22079:
skillId=26057;
break;
case 22080:
skillId=26058;
break;
case 22081:
skillId=26059;
break;

}
// Send message to client
activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ENABLED_SPIRITSHOT));
Broadcast.toSelfAndKnownPlayersInRadius(activeChar, new MagicSkillUse(activeChar, activeChar, skillId, 1, 0, 0), 360000);
}
}


SoulShots.java

package handlers.itemhandlers;

import com.l2jserver.gameserver.handler.IItemHandler;
import com.l2jserver.gameserver.model.L2ItemInstance;
import com.l2jserver.gameserver.model.actor.L2Playable;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse;
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
import com.l2jserver.gameserver.skills.Stats;
import com.l2jserver.gameserver.templates.item.L2Item;
import com.l2jserver.gameserver.templates.item.L2Weapon;
import com.l2jserver.gameserver.util.Broadcast;

/**
* This class ...
*
* @version $Revision: 1.2.4.4 $ $Date: 2005/03/27 15:30:07 $
*/

public class SoulShots implements IItemHandler
{
/**
*
* @see com.l2jserver.gameserver.handler.IItemHandler#useItem(com.l2jserver.gameserver.model.actor.L2Playable, com.l2jserver.gameserver.model.L2ItemInstance, boolean)
*/
public void useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
{
if (!(playable instanceof L2PcInstance))
return;

L2PcInstance activeChar = (L2PcInstance) playable;
L2ItemInstance weaponInst = activeChar.getActiveWeaponInstance();
L2Weapon weaponItem = activeChar.getActiveWeaponItem();
int itemId = item.getItemId();

// Check if Soul shot can be used
if (weaponInst == null || weaponItem.getSoulShotCount() == 0)
{
if (!activeChar.getAutoSoulShot().contains(itemId))
activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CANNOT_USE_SOULSHOTS));
return;
}

final int weaponGrade = weaponItem.getCrystalType();

boolean gradeCheck = true;

switch (weaponGrade)
{
case L2Item.CRYSTAL_NONE:
if (itemId != 5789 && itemId != 1835)
gradeCheck = false;
break;
case L2Item.CRYSTAL_D:
if (itemId != 1463 && itemId != 22082)
gradeCheck = false;
break;
case L2Item.CRYSTAL_C:
if (itemId != 1464 && itemId != 22083)
gradeCheck = false;
break;
case L2Item.CRYSTAL_B:
if (itemId != 1465 && itemId != 22084)
gradeCheck = false;
break;
case L2Item.CRYSTAL_A:
if (itemId != 1466 && itemId != 22085)
gradeCheck = false;
break;
case L2Item.CRYSTAL_S:
case L2Item.CRYSTAL_S80:
case L2Item.CRYSTAL_S84:
if (itemId != 1467 && itemId != 22086)
gradeCheck = false;
break;
}

if (!gradeCheck)
{
if (!activeChar.getAutoSoulShot().contains(itemId))
activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.SOULSHOTS_GRADE_MISMATCH));

return;
}

activeChar.soulShotLock.lock();
try
{
// Check if Soul shot is already active
if (weaponInst.getChargedSoulshot() != L2ItemInstance.CHARGED_NONE)
return;

// Consume Soul shots if player has enough of them
int saSSCount = (int) activeChar.getStat().calcStat(Stats.SOULSHOT_COUNT, 0, null, null);
int SSCount = saSSCount == 0 ? weaponItem.getSoulShotCount() : saSSCount;

if (!activeChar.destroyItemWithoutTrace("Consume", item.getObjectId(), SSCount, null, false))
{
if (!activeChar.disableAutoShot(itemId))
activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOT_ENOUGH_SOULSHOTS));
return;
}

// Charge soul shot
weaponInst.setChargedSoulshot(L2ItemInstance.CHARGED_SOULSHOT);
}
finally
{
activeChar.soulShotLock.unlock();
}
int skillId = 0;
switch (itemId)
{
case 1835:
case 5789:
skillId=2039;
break;
case 1463:
skillId=2150;
break;
case 1464:
skillId=2151;
break;
case 1465:
skillId=2152;
break;
case 1466:
skillId=2153;
break;
case 1467:
skillId=2154;
break;
case 22082:
skillId=26060;
break;
case 22083:
skillId=26061;
break;
case 22084:
skillId=26062;
break;
case 22085:
skillId=26063;
break;
case 22086:
skillId=26064;
break;

}
// Send message to client
activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ENABLED_SOULSHOT));
Broadcast.toSelfAndKnownPlayersInRadius(activeChar, new MagicSkillUse(activeChar, activeChar, skillId, 1, 0, 0), 360000);
}
}



Буду очень благодарен тому кто мне объяснит, что и как нужно сделать.
Ответ
#2
PHP код:
<?php 
destroyItemWithoutTrace
Ответ
#3
Там откомментировано все..

SpiritShot.java[src=JAVA]
// Consume Spirit shot if player has enough of them
if (!activeChar.destroyItemWithoutTrace("Consume", item.getObjectId(), weaponItem.getSpiritShotCount(), null, false))
{
if (!activeChar.disableAutoShot(itemId))
activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOT_ENOUGH_SPIRITSHOTS));
return;
}

[/src]


SoulShots.java[src=java]
int SSCount = saSSCount == 0 ? weaponItem.getSoulShotCount() : saSSCount;

if (!activeChar.destroyItemWithoutTrace("Consume", item.getObjectId(), SSCount, null, false))
{
if (!activeChar.disableAutoShot(itemId))
activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOT_ENOUGH_SOULSHOTS));
return;
}

[/src]
Ответ
#4
Да вы правы. Я видимо не внимательно читал Sad

Спасибо в любом случае
Ответ


Возможно похожие темы ...
Тема Автор Ответы Просмотры Последний пост
  Нужна помощь с ошибкой Dominion_KillSpecialUnitQuest RuSmith 1 2,227 10-12-2020, 12:36 PM
Последний пост: DOBA
  Срочно нужна помощь "Платно" SiniyVov4 8 2,683 04-04-2018, 09:30 AM
Последний пост: SiniyVov4
  Нужна помощь с крафтом Mouzes 0 973 12-22-2015, 07:20 AM
Последний пост: Mouzes
  нид помощь MaxLindvior 8 2,144 12-12-2015, 07:19 PM
Последний пост: Gaikotsu
  BufferHolder от Ro0TT нужна помощь Masone 6 2,271 01-28-2015, 06:12 PM
Последний пост: Masone
  Нужна Помощь RekpyT 5 1,702 09-13-2014, 03:04 PM
Последний пост: Donatte
  Требуется дата пакер Gaspar 6 1,969 02-16-2014, 07:41 AM
Последний пост: Deazer
  Нужна помощь по бафферу Lordy 6 1,834 09-23-2013, 06:47 PM
Последний пост: ExLite
  Нужна помощь не сохраняются бафы Imp. Gadzhishka 6 1,837 08-17-2013, 10:47 AM
Последний пост: DiagoD
  Помощь с скриптами Jigulixa 9 2,223 05-06-2013, 08:25 PM
Последний пост: SoniPro

Перейти к форуму:


Пользователи, просматривающие эту тему: 1 Гость(ей)