diff --git a/changelog.txt b/changelog.txt index cf180b003..fa0fdb2aa 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 09/30/2013 == +Sorvani: Changed SummonItem to only summon an item with max charges when said default value is present and not on zero charges + == 09/13/2013 == demonstar55: Add support for /pet hold on and /pet hold off (UF and RoF) diff --git a/zone/client.h b/zone/client.h index ebf83c804..7adbc421f 100644 --- a/zone/client.h +++ b/zone/client.h @@ -785,7 +785,7 @@ public: void QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call = false); void PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootItem_Struct** bag_item_data = 0); bool AutoPutLootInInventory(ItemInst& inst, bool try_worn = false, bool try_cursor = true, ServerLootItem_Struct** bag_item_data = 0); - void SummonItem(uint32 item_id, int16 charges = 0, uint32 aug1=0, uint32 aug2=0, uint32 aug3=0, uint32 aug4=0, uint32 aug5=0, bool attuned=false, uint16 to_slot=SLOT_CURSOR); + void SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1=0, uint32 aug2=0, uint32 aug3=0, uint32 aug4=0, uint32 aug5=0, bool attuned=false, uint16 to_slot=SLOT_CURSOR); void SetStats(uint8 type,int16 set_val); void IncStats(uint8 type,int16 increase_val); void DropItem(int16 slot_id); diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 5793e2ae9..5b9147c7f 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -208,11 +208,13 @@ void Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, return; } else { // if 0 and max charges 0 and stackable, set the created item charge to 1 - if (charges == 0 && item->MaxCharges == 0 && item->Stackable) + if (charges == 0 && item->MaxCharges == 0 && item->Stackable) { charges = 1; - // if 0 or no charge value was passed, set the created item charge to max charges - else if(charges == 0) + // if the charges is -1, then no charge value was passed in set to max charges + } else if(charges == -1) { charges = item->MaxCharges; + // in any other situatino just use charges as passed + } } // Checking to see if the Item is lore or not. bool foundlore = CheckLoreConflict(item); diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index e1a3538c0..3fb012329 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -3049,7 +3049,7 @@ XS(XS_Client_SummonItem) { Client * THIS; uint32 item_id = (uint32)SvUV(ST(1)); - int16 charges = 0; + int16 charges = -1; bool attune = false; uint32 aug1 = 0; uint32 aug2 = 0; diff --git a/zone/questmgr.h b/zone/questmgr.h index fa5ec0655..fbd9702fa 100644 --- a/zone/questmgr.h +++ b/zone/questmgr.h @@ -52,7 +52,7 @@ public: void say(const char *str); void say(const char *str, uint8 language); void me(const char *str); - void summonitem(uint32 itemid, int16 charges = 0); + void summonitem(uint32 itemid, int16 charges = -1); void write(const char *file, const char *str); Mob* spawn2(int npc_type, int grid, int unused, float x, float y, float z, float heading); Mob* unique_spawn(int npc_type, int grid, int unused, float x, float y, float z, float heading = 0);