From 696de1309b9ec394fb77d9275d65f621091285f1 Mon Sep 17 00:00:00 2001 From: emudevs Date: Mon, 22 Sep 2014 01:05:53 -0400 Subject: [PATCH 1/5] Updated GetAITarget documentation with target types --- CreatureMethods.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CreatureMethods.h b/CreatureMethods.h index 2dc8d84..26add92 100644 --- a/CreatureMethods.h +++ b/CreatureMethods.h @@ -634,6 +634,17 @@ namespace LuaCreature * Returns a target from the [Creature]'s threat list based on the * supplied arguments. * + *
+     * enum SelectAggroTarget
+     * {
+     *     SELECT_TARGET_RANDOM = 0, //Just selects a random target
+     *     SELECT_TARGET_TOPAGGRO, //Selects targes from top aggro to bottom
+     *     SELECT_TARGET_BOTTOMAGGRO, //Selects targets from bottom aggro to top
+     *     SELECT_TARGET_NEAREST,
+     *     SELECT_TARGET_FARTHEST
+     * };
+     * 
+ * * For example, if you wanted to select the third-farthest [Player] * within 50 yards that has the [Aura] "Corrupted Blood" (ID 24328), * you could use this function like so: From 774df595a6ae50c4b3db9e7b2cca8682ef78fc5b Mon Sep 17 00:00:00 2001 From: emudevs Date: Mon, 22 Sep 2014 01:08:10 -0400 Subject: [PATCH 2/5] Corrected typo --- CreatureMethods.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CreatureMethods.h b/CreatureMethods.h index 26add92..0942f82 100644 --- a/CreatureMethods.h +++ b/CreatureMethods.h @@ -637,8 +637,8 @@ namespace LuaCreature *
      * enum SelectAggroTarget
      * {
-     *     SELECT_TARGET_RANDOM = 0, //Just selects a random target
-     *     SELECT_TARGET_TOPAGGRO, //Selects targes from top aggro to bottom
+     *     SELECT_TARGET_RANDOM = 0,  //Just selects a random target
+     *     SELECT_TARGET_TOPAGGRO,    //Selects targets from top aggro to bottom
      *     SELECT_TARGET_BOTTOMAGGRO, //Selects targets from bottom aggro to top
      *     SELECT_TARGET_NEAREST,
      *     SELECT_TARGET_FARTHEST

From 0c72883009c254e6a13353ec98f78f9a4a30775d Mon Sep 17 00:00:00 2001
From: Foereaper 
Date: Mon, 22 Sep 2014 19:34:43 +0200
Subject: [PATCH 3/5] Changed AddItem to return item object

---
 PlayerMethods.h | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/PlayerMethods.h b/PlayerMethods.h
index 3b8cd1b..01b5267 100644
--- a/PlayerMethods.h
+++ b/PlayerMethods.h
@@ -1972,10 +1972,23 @@ namespace LuaPlayer
     {
         uint32 itemId = Eluna::CHECKVAL(L, 2);
         uint32 itemCount = Eluna::CHECKVAL(L, 3);
+
 #ifndef TRINITY
-        Eluna::Push(L, player->StoreNewItemInInventorySlot(itemId, itemCount) ? true : false);
+        Eluna::Push(L, player->StoreNewItemInInventorySlot(itemId, itemCount));
 #else
-        Eluna::Push(L, player->AddItem(itemId, itemCount));
+        uint32 noSpaceForCount = 0;
+        ItemPosCountVec dest;
+        InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, itemCount, &noSpaceForCount);
+        if (msg != EQUIP_ERR_OK)
+            itemCount -= noSpaceForCount;
+
+        if (itemCount == 0 || dest.empty())
+            return 1;
+
+        Item* item = player->StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
+        if (item)
+            player->SendNewItem(item, itemCount, true, false);
+        Eluna::Push(L, item);
 #endif
         return 1;
     }

From 8b0a89e68f51e3f7b9900454f103af088ae40ee6 Mon Sep 17 00:00:00 2001
From: Rochet2 
Date: Wed, 24 Sep 2014 20:09:10 +0300
Subject: [PATCH 4/5] Update MERGING.md

---
 docs/MERGING.md | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/docs/MERGING.md b/docs/MERGING.md
index 943482f..fd6432c 100644
--- a/docs/MERGING.md
+++ b/docs/MERGING.md
@@ -1,10 +1,16 @@
-#Merging
-1. You should have/get the source code of TrinityCore or MaNGOS.
-2. Open `git bash` in the source folder.
-3. Create a remote to our Eluna core repository with `git remote add Eluna `, for example for TC WoTLK it would be
-`git remote add Eluna https://github.com/ElunaLuaEngine/Eluna-TC-Wotlk.git`.
-4. Pull (fetch and merge) the eluna core repository to your TC or MaNGOS source with `git pull Eluna master`.
-5. Open `git bash` and do
-`git submodule init`
-`git submodule update`
-6. Compile the core normally (use cmake if needed)
+#Merging Eluna with MaNGOS
+Eluna is already merged with official MaNGOS by default
+
+#Merging Eluna with TC
+```
+git clone --recursive https://github.com/ElunaLuaEngine/ElunaTrinityWotlk.git
+cd ElunaTrinityWotlk
+git pull https://github.com/TrinityCore/TrinityCore.git
+```
+Steps explained:
+
+1. clone Eluna recursively
+ * This will automatically pull the submodule (Eluna repo)
+2. go to the source folder
+3. pull (fetch and merge) TC with the Eluna source.
+ * Adding Eluna core repository as a remote is recommended

From 9814d8571af1f18cb06d015a20dcb59e1fa55c15 Mon Sep 17 00:00:00 2001
From: Rochet2 
Date: Wed, 24 Sep 2014 20:11:00 +0300
Subject: [PATCH 5/5] Update MERGING.md

---
 docs/MERGING.md | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/docs/MERGING.md b/docs/MERGING.md
index fd6432c..94a53fb 100644
--- a/docs/MERGING.md
+++ b/docs/MERGING.md
@@ -3,14 +3,14 @@ Eluna is already merged with official MaNGOS by default
 
 #Merging Eluna with TC
 ```
-git clone --recursive https://github.com/ElunaLuaEngine/ElunaTrinityWotlk.git
-cd ElunaTrinityWotlk
-git pull https://github.com/TrinityCore/TrinityCore.git
+git clone https://github.com/TrinityCore/TrinityCore.git
+cd TrinityCore
+git pull --recurse-submodules https://github.com/ElunaLuaEngine/ElunaTrinityWotlk.git
 ```
 Steps explained:
 
-1. clone Eluna recursively
- * This will automatically pull the submodule (Eluna repo)
+1. clone TrinityCore
 2. go to the source folder
-3. pull (fetch and merge) TC with the Eluna source.
+3. pull (fetch and merge) Eluna with the source.
+ * recurse-submodules will automatically pull the submodule (Eluna repo)
  * Adding Eluna core repository as a remote is recommended