This commit is contained in:
Rochet2
2014-09-29 16:37:21 +03:00
3 changed files with 42 additions and 12 deletions

View File

@@ -634,6 +634,17 @@ namespace LuaCreature
* Returns a target from the [Creature]'s threat list based on the
* supplied arguments.
*
* <pre>
* enum SelectAggroTarget
* {
* 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
* };
* </pre>
*
* 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:

View File

@@ -1972,10 +1972,23 @@ namespace LuaPlayer
{
uint32 itemId = Eluna::CHECKVAL<uint32>(L, 2);
uint32 itemCount = Eluna::CHECKVAL<uint32>(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;
}

View File

@@ -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 <repoaddress>`, 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 https://github.com/TrinityCore/TrinityCore.git
cd TrinityCore
git pull --recurse-submodules https://github.com/ElunaLuaEngine/ElunaTrinityWotlk.git
```
Steps explained:
1. clone TrinityCore
2. go to the source folder
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