--- QuestState.java 2005-10-21 10:17:51.000000000 -0300
+++ /mnt/web/testarea/l2j/source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/model/quest/QuestState.java 2005-10-19 18:00:52.000000000 -0300
@@ -291,8 +291,8 @@
varint = Integer.parseInt(vars.get(var));
} catch (Exception e) {
_log.warning(getPlayer().getName()+": variable "+var+" isn't an integer: " + varint + e);
-// if (Config.AUTODELETE_INVALID_QUEST_DATA)
-// exitQuest(true);
+// if (Config.AUTODELETE_INVALID_QUEST_DATA)
+// exitQuest(true);
}
return varint;
}
@@ -435,6 +435,9 @@
L2ItemInstance item = ItemTable.getInstance().createItem(itemId);
if (item == null)
return;
+ // If item for reward is gold (ID=57), modify count with rate for quest reward
+ if (item.getItemId() == 57)
+ count=(int)(count*Config.RATE_QUESTS_REWARD);
// Set quantity of item
item.setCount(count);
// Add items to player's inventory
@@ -459,51 +462,6 @@
player.sendPacket(il);
}
}
-
-// we need this for things like enhance, because we just take the item and give the player a new one... but he has not to know this.
-//this is one reason for this, the other one is to count unstackable items without the player knows that we are take and give him some items.
- /**
- * Give item/reward to the player, can hide smsg.
- * @param itemId
- * @param count
- * @param msg: if this is true, msg will show up
- */
- public void giveItems(int itemId, int count, boolean msg) {
- if (count <= 0)
- count = 1;
- // Create new instance for the item
- L2ItemInstance item = ItemTable.getInstance().createItem(itemId);
- if (item == null)
- return;
- // Set quantity of item
- item.setCount(count);
- // Add items to player's inventory
- player.getInventory().addItem(item);
- if (msg)
- {
- // If item for reward is gold, send message of gold reward to client
- if (item.getItemId() == 57)
- {
- SystemMessage smsg = new SystemMessage(SystemMessage.EARNED_ADENA);
-// smsg.addNumber(item.getCount());
- smsg.addNumber(count);
- player.sendPacket(smsg);
- ItemList il = new ItemList(player, false);
- player.sendPacket(il);
- }
- // Otherwise, send message of object reward to client
- else
- {
- SystemMessage smsg = new SystemMessage(SystemMessage.EARNED_ITEM);
- smsg.addNumber(count);
- smsg.addItemName(item.getItemId());
- player.sendPacket(smsg);
- ItemList il = new ItemList(player, false);
- player.sendPacket(il);
- }
- }
- }
-
//TODO: More radar functions need to be added when the radar class is complete.
// BEGIN STUFF THAT WILL PROBABLY BE CHANGED
public void addRadar(int x, int y, int z){
@@ -541,55 +499,20 @@
// Destroy the quantity of items wanted
player.getInventory().destroyItemByItemId(itemId, count);
// Send message of destruction to client
- SystemMessage smsg;
- if (itemId == 57){
- smsg = new SystemMessage(SystemMessage.DISSAPEARED_ADENA);
- smsg.addNumber(count);
- }else{
- smsg = new SystemMessage(SystemMessage.DISSAPEARED_ITEM);
- smsg.addItemName(itemId);
- }
+ SystemMessage smsg;
+ if (itemId == 57){
+ smsg = new SystemMessage(SystemMessage.DISSAPEARED_ADENA);
+ smsg.addNumber(count);
+ }else{
+ smsg = new SystemMessage(SystemMessage.DISSAPEARED_ITEM);
+ smsg.addItemName(itemId);
+ }
player.sendPacket(smsg);
// Create and send new inventory list to client
ItemList il = new ItemList(player, false);
player.sendPacket(il);
}
-//we need this for things like enhance, because we just take the item and give the player a new one... but he has not to know this.
-//this is one reason for this, the other one is to count unstackable items without the player knows that we are take and give him some items. Maybe for Blacksmith and so on.
- /**
- * Remove items from player's inventory when talking to NPC in order to have rewards. Can hide smsg.
- * Actions :
- *