Author: aion4free
(2010/07/29 21:10) Over 1 year ago
Campaign quest item can't be removed till quest is finished
14
public static final int TEMP_ITEM = (1 << 7);
15
public static final int UNK9 = (1 << 8);
16
public static final int STORABLE_IN_LEGION_WH = (1 << 9);
17
public static final int UNK11 = (1 << 10);
public static final int UNDELETABLE_QUEST_ITEMS = (1 << 10);
18
public static final int UNK12 = (1 << 11);
19
public static final int BLACK_CLOUD_TRADERS = (1 << 12);
20
public static final int CAN_SPLIT = (1 << 13);
584
{
585
return (getMask() & ItemMask.TRADEABLE) == ItemMask.TRADEABLE;
586
}
587
588
/**
589
*
590
* @return
591
*/
592
public boolean isUndeletableQuestItem()
593
594
return (getMask() & ItemMask.UNDELETABLE_QUEST_ITEMS) == ItemMask.UNDELETABLE_QUEST_ITEMS;
595
596
21
import com.aionemu.gameserver.model.gameobjects.player.Storage;
22
import com.aionemu.gameserver.network.aion.AionClientPacket;
23
import com.aionemu.gameserver.network.aion.serverpackets.SM_DELETE_ITEM;
24
import com.aionemu.gameserver.network.aion.serverpackets.SM_SYSTEM_MESSAGE;
25
import com.aionemu.gameserver.utils.PacketSendUtility;
26
import com.aionemu.gameserver.model.DescriptionId;
27
28
* @author Avol
29
...
49
Player player = getConnection().getActivePlayer();
52
50
Storage bag = player.getInventory();
53
51
Item resultItem = bag.getItemByObjId(objId);
54
55
if (resultItem.getItemTemplate().isUndeletableQuestItem())
56
57
PacketSendUtility.sendPacket(player, SM_SYSTEM_MESSAGE.STR_QUEST_GIVEUP_WHEN_DELETE_QUEST_ITEM_IMPOSSIBLE(new DescriptionId(Integer
58
.parseInt(resultItem.getName())))); // TODO specify the quest name wich item belongs to
59
return;
60
if (resultItem != null)
61
bag.removeFromBag(resultItem, true);
62
sendPacket(new SM_DELETE_ITEM(objId));
63
1023
* You cannot use the item as its cooldown time has not expired yet.
1024
1025
public static SM_SYSTEM_MESSAGE STR_ITEM_CANT_USE_UNTIL_DELAY_TIME = new SM_SYSTEM_MESSAGE(1300494);
1026
1027
1028
* You cannot destroy %0 because it is used in the "%1" quest which cannot be abandoned once started.
1029
1030
public static SM_SYSTEM_MESSAGE STR_QUEST_GIVEUP_WHEN_DELETE_QUEST_ITEM_IMPOSSIBLE(DescriptionId nameId)
1031
1032
return new SM_SYSTEM_MESSAGE(1300604, nameId);
1033
1034
1035
* You cannot fly in this area.
1036
public static final int UNK11 = (1 << 10);public static final int UNDELETABLE_QUEST_ITEMS = (1 << 10);{{{{{