Jump to content
  • 0

Repairing Quests?


tallah

Question

3 answers to this question

Recommended Posts

Okay thank you Antz, I'll have a look in a bit

Would you happen to be able to show me where I will need to look at how to repair or script a quest according to online resources?

I can look up quest relation, and quest id's in my database i just don't know how to make the two synchronize

Link to comment
Share on other sites

A PM is under way with the information you requested earlier :) Will also post that here whenever for future reference

Edit: Excerpt from the PM sent to Tallah with some basic info

Hey there,

Scripting with Eluna is fairly straight forward. It is based on the concept of events, functions and methods, like on any other Lua engine. Functions can be registered to specific events, like OnQuestAccept, which is what you would want to use when fixing quests primarily. It will trigger whenever players pick up quests, and you can then write out the code of what is to happen whenever the said event is triggered.

As an example:

local npcid = NPC_ENTRY_HERE -- Set the entry ID of the creature giving out the quest here

function OnQuestAccept(event, player, creature, quest) -- Do mind, you can name a function whatever you would like
   if(quest:GetId() == QUEST_ID_HERE) -- Set the correct quest entry ID there
       player:SendBroadcastMessage("This broadcast is sent to the player when the quest is accepted!") -- The SendBroadcastMessage() method sends a broadcast to the player when used like above
   end
end

RegisterCreatureEvent(npcid, 31, OnQuestAccept) -- The quest pickup is registered to the creature giving out the said quest

-- The below hook is what you use for the OnQuestAccept event. Event ID is 31 (used in the hook), followed by the arguments pushed to the function
-- CREATURE_EVENT_ON_QUEST_ACCEPT = 31, // (event, player, creature, quest)

The above is a very simple example of workable code. I added some comments to it to show you how it works. Lua scripts are saved as .lua files within the Lua_scripts folder in your server folder. You can reload the Lua engine for testing ingame by using the .reload eluna command.

Resources:

Currently we're in the middle of creating a new documentation/wiki site, so please bare with us while we get this sorted.

- Most methods can be found here: eluna.emudevs.com

- Hooks can be found here for now, will be moved to the above shortly: eluna []

If something is undocumented on the wiki, you can find temporary documentation here: https://github.com/ElunaLuaEngine/El...aFunctions.cpp

If you have any more questions or need some help, feel free to send me another PM or create a topic on the forum

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use