Jump to content

Foereaper

getMaNGOS Developer
  • Content Count

    596
  • Donations

    0.00 GBP 
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Foereaper

  1. http://www.elunaengine.com/Global/PerformIngameSpawn.html PerformIngameSpawn has an optional variable after orientation you can use to save the creature to the database :)
  2. Xardion, I primarily do windows development, and I have that working properly, would you be interested in helping me out with the Linux side of things? Primarily testing, as I don't have a Linux test environment set up atm
  3. This might be a bit late, but I am currently working on implementing LuaSocket and LuaSec as officially supported modules for Eluna
  4. Like the error says, you are trying to compare a string to a number, change either of your variables to the desired type.
  5. Yes, what you did below would also work, the original example however stores the data specifically to a Lua table so the information can be used/re-used at a later time without having to query the database again. Instead of printing "datee" directly like you tried to, you would use the table DatabaseCache with the account ID as a key to call the specific information, like shown below: local DatabaseCache = {} local function LoadDatabase(event, player) local ExampleQuery = CharDBQuery("SELECT active, date FROM premium WHERE AccountId = "..player:GetAccountId()); if(ExampleQuery)then repeat DatabaseCache[player:GetAccountId()] = { active = ExampleQuery:GetUInt32(0), datee = ExampleQuery:GetUInt32(1) }; until not ExampleQuery:NextRow() end print(DatabaseCache[player:GetAccountId()].datee) end RegisterPlayerEvent(18, LoadDatabase) If you just want a single one-time use query, then you should do this: local function LoadDatabase(event, player) local resultado = CharDBQuery("SELECT active, date FROM premium WHERE AccountId = "..player:GetAccountId()) if(resultado) then local active, date = resultado:GetString(0), resultado:GetUInt32(1); end print (datee) end RegisterPlayerEvent(18, LoadDatabase)
  6. You need to update your query to select all the necessary information that you need, you're currently only selecting date, not everything else you need as well local DatabaseCache = {} local function LoadDatabase(event, player) local ExampleQuery = CharDBQuery("SELECT active, date FROM premium WHERE AccountId = "..player:GetAccountId()); if(ExampleQuery)then repeat DatabaseCache[player:GetAccountId()] = { active = ExampleQuery:GetUInt32(0), datee = ExampleQuery:GetUInt32(1) }; until not ExampleQuery:NextRow() end end RegisterPlayerEvent(18, LoadDatabase)
  7. Foereaper

    Error in lua

    Grumbo's VIP chat script isn't stand-alone, check the original repo for more information: https://github.com/BlackWolfsDen/Eluna-Grumboz_VIP_System-Complete
  8. As a side note, this will prevent EVERY error box from showing for any other program as well, as well for debug builds. Use at your own risk
  9. Glad to hear you got it working, and yeah, the service part is a bit iffy, I never actually bothered to try setting it up properly hehe.
  10. Yes, depending on your current database version and the expected database version, as seen in the world log during startup. It will tell you the structure you have and what is expected, and you run any updates from the update folder in correct order between those two points.
  11. You either have to connect to the database and execute the update sql files via a client like heidisql or sqlyog, or through the MySQL command line tool. Either works, though I prefer to use a client.
  12. It should be called world-server.log, log directory can be set in the configs
  13. You'll have to post the full log, what you're showing there doesn't really say anything that could determine what the issue is
  14. Foereaper

    Aio setup

    That is most likely a custom method then
  15. Foereaper

    Aio setup

    UpdateStatPoints is probably a custom method, it is not something that is part of Eluna by default at least. Where did you get that method from? Only function I see called in the original script is UpdatePlayerStats(player)
  16. If it finds the config files, you can change the default data dirs within the config files, thus use whatever directory you'd like
  17. Foereaper

    Aio setup

    local function AttributesInitPoints(guid) local playerGUID = player:GetGUIDLow() The local playerGUID is unnecessary, considering you get the guid from the call in OnLogin, and you can simply pass that guid. Considering you are not passing the 'player' variable to the function but just the guid, player is not a valid variable to use, as it is not a global variable. So simply do it like this: local function AttributesInitPoints(guid) AttributesPointsLeft[guid] = WorldDBQuery("SELECT RemainPoints FROM statssave WHERE GUID = "..guid) AttributesPointsSpend[guid] = {WorldDBQuery("SELECT Force, Agilité, Endurance, Intelligence, Esprit FROM statssave WHERE GUID = "..guid)} end Same for AttributesDeinitPoints, what is this supposed to do actually? Just update the database table? If so, consider renaming the function.
  18. That is correct, by default it searches for the data directories within the binary directory
  19. http://www.elunaengine.com/?search=Phase
  20. So, when a method is not exposed to Eluna, in this case SetLoyaltyLevel, there are several ways to implement similar functionality. First of all, we should see how SetLoyaltyLevel is actually handled in the core; https://github.com/mangoszero/server/blob/756c8ff79723f3bf46eccc4bb819fc0e30ff3cc1/src/game/Object/Pet.cpp#L737 As you can see in the above link, SetLoyaltyLevel is handled by setting one of the pets' Byte values. While SetLoyaltyLevel in and of itself is not an Eluna method, SetByteValue however is. http://www.elunaengine.com/Object/SetByteValue.html As you can see from that link, SetByteValue as Eluna uses it is exactly the same as the way the core uses it. Thus we can re-create the functionality in Eluna as long as we also have the same values as passed to the core function; Before we start recreating the functionality by using Elunas' SetByteValue, we need to know the correct values to pass to the method. In this case we need Index, Offset and Value. So the first value (index), which is the unit byte we want to edit, can be found here. https://github.com/mangoszero/server/blob/d0a4af096e528533044e7029446d1c5c9e98a16c/src/game/Object/UpdateFields.h#L137 This is written in hex. Eluna does support using hex values as well, though for simplicity I usually convert it to a decimal. UNIT_FIELD_BYTES_1 = 0x84 + OBJECT_END (0x06) This means we have 0x84+0x06. In decimal this would mean UNIT_FIELD_BYTES_1 = 138. The next value, which is the offset, is 1. This can simply be copied directly from the SetLoyaltyLevel function. Third and final value, as shown in your own example, is BEST_FRIEND. This is defined in the loyalty level enum as shown below. https://github.com/mangoszero/server/blob/d0a4af096e528533044e7029446d1c5c9e98a16c/src/game/Object/Pet.h#L80 The value we want is BEST_FRIEND, as shown in the above link = 6. Now, with all the values, we can use Rochet's script as a template for how we retrieve the actual pet, and how we change its loyalty using all of the above values we have determined is needed; local pet = player:GetMap():GetWorldObject(player:GetPetGUID()) if pet then pet:SetByteValue(138, 1, 6) -- Sets pet loyalty to best friend end This should set your pets loyalty level to best friend. I have not tested it though, this was more of an example as to how functionality can be implemented in Eluna without having to modify the engine itself. PS: You should probably not use "magic numbers" like I have shown above, as they should be localized properly. Numbers without definition wouldn't make any sense to anyone else trying to read your code.
  21. Foereaper

    Gm badge on

    The above core if retrieved from Elunas repository is based on cmangos. Mangos one which is for tbc already has Eluna included.
  22. https://github.com/ElunaLuaEngine/Scripts/tree/master/Custom/Redeemer This script allows you to redeem codes for things like titles, gold or items. Simply put the script in your server script folder and change the npc entry in the script to whatever npc you want to work as your redeemer
  23. First of all you need to decide on your approach. You can either find a spell that changes the XP rates, if they even exist in classic, or you would have to make a script for it. If the latter, let me know and I'll assist you.
  24. http://prntscr.com/eim9yq Just logged in and checked, they spawned instantly for me. Did you check in several places or just a specific area?
  25. An update to Warden has been pushed, please update and try again

Contact Us

To contact us click here
You can also email us at [email protected]

Privacy Policy | Terms & Conditions

Repositories

The Link to the master list
of MaNGOS repositories:
Copyright © getMaNGOS. All rights Reserved.

This website is in no way associated with or endorsed by Blizzard Entertainment®
×
×
  • Create New...