Changeset 2596

User picture

Author: aion4free

(2010/07/29 21:10) Over 1 year ago

Campaign quest item can't be removed till quest is finished

Affected files

Updated trunk/AE-go_GameServer/src/com/aionemu/gameserver/model/items/ItemMask.java Download diff

25952596
14
	public static final int TEMP_ITEM = (1 << 7);
14
	public static final int TEMP_ITEM = (1 << 7);
15
	public static final int UNK9 = (1 << 8);
15
	public static final int UNK9 = (1 << 8);
16
	public static final int STORABLE_IN_LEGION_WH = (1 << 9);
16
	public static final int STORABLE_IN_LEGION_WH = (1 << 9);
17
	public static final int UNK11 = (1 << 10);
17
	public static final int UNDELETABLE_QUEST_ITEMS = (1 << 10);
18
	public static final int UNK12 = (1 << 11);
18
	public static final int UNK12 = (1 << 11);
19
	public static final int BLACK_CLOUD_TRADERS = (1 << 12);
19
	public static final int BLACK_CLOUD_TRADERS = (1 << 12);
20
	public static final int CAN_SPLIT = (1 << 13);
20
	public static final int CAN_SPLIT = (1 << 13);

Updated trunk/AE-go_GameServer/src/com/aionemu/gameserver/model/templates/item/ItemTemplate.java Download diff

25952596
584
	{
584
	{
585
		return (getMask() & ItemMask.TRADEABLE) == ItemMask.TRADEABLE;
585
		return (getMask() & ItemMask.TRADEABLE) == ItemMask.TRADEABLE;
586
	}
586
	}
587
	
588
	/**
589
	 * 
590
	 * @return
591
	 */
592
	public boolean isUndeletableQuestItem()
593
	{
594
		return (getMask() & ItemMask.UNDELETABLE_QUEST_ITEMS) == ItemMask.UNDELETABLE_QUEST_ITEMS;
595
	}
587
}
596
}

Updated trunk/AE-go_GameServer/src/com/aionemu/gameserver/network/aion/clientpackets/CM_DELETE_ITEM.java Download diff

25952596
21
import com.aionemu.gameserver.model.gameobjects.player.Storage;
21
import com.aionemu.gameserver.model.gameobjects.player.Storage;
22
import com.aionemu.gameserver.network.aion.AionClientPacket;
22
import com.aionemu.gameserver.network.aion.AionClientPacket;
23
import com.aionemu.gameserver.network.aion.serverpackets.SM_DELETE_ITEM;
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;
24
/**
27
/**
25
 * 
28
 * 
26
 * @author Avol
29
 * @author Avol
...
...
49
		Player player = getConnection().getActivePlayer();
52
		Player player = getConnection().getActivePlayer();
50
		Storage bag = player.getInventory();
53
		Storage bag = player.getInventory();
51
		Item resultItem = bag.getItemByObjId(objId);
54
		Item resultItem = bag.getItemByObjId(objId);
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
		}
52
		if (resultItem != null)
61
		if (resultItem != null)
53
			bag.removeFromBag(resultItem, true);
62
			bag.removeFromBag(resultItem, true);
54
		sendPacket(new SM_DELETE_ITEM(objId));
63
		sendPacket(new SM_DELETE_ITEM(objId));

Updated trunk/AE-go_GameServer/src/com/aionemu/gameserver/network/aion/serverpackets/SM_SYSTEM_MESSAGE.java Download diff

25952596
1023
	 * You cannot use the item as its cooldown time has not expired yet.
1023
	 * You cannot use the item as its cooldown time has not expired yet.
1024
	 */
1024
	 */
1025
	public static SM_SYSTEM_MESSAGE	STR_ITEM_CANT_USE_UNTIL_DELAY_TIME	= new SM_SYSTEM_MESSAGE(1300494);
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
	}
1026
1034
1027
	/**
1035
	/**
1028
	 * You cannot fly in this area.
1036
	 * You cannot fly in this area.