# Forum > News > OC News >  The Emulation Scene - May 2009

## KuRIoS

Our Emulation Experts is doing monthly updates on what is going on in the emulation environment on MMOwned. 
 
This months’ update is sort of a big one because of the new patch and it being the first “release” if you can call it that. Maybe – and highly likely - we will change the way it is done along the way, but lets see if it’s a success first and then decide on what should be changed. Since the posts have quite a lot of info, we will be linking to each of the “articles” in the main post.

 

*Patch 3.1 The race to finish* – Hellgawd is talking about the new patch that hit World of Warcraft and the emulation environment, patch 3.1 and what impact it had in the emulation scene.
 Patch 3.1 The race to finish



*lua – Laughing under anna??* – Stoneharrys article is about lua, what it is and what it can be used for when it comes to emulator servers, what he thinks is so good about it and generally why he uses it.
 Lua



*Beyond the teleporter – teleporter? But I am not an engineer…* - Gastricpenguin has written an article about Gossip/C++ scripts and what they can be used for, “What about an NPC that heals you when you shout “Help!”?”
 Beyond the Teleporter



*New Emulation experts requirements* – 2dgreengiant is informing you about the new requirements that are put in place if you are interested in being a part of the Emulator experts group.
 New Emulation Experts requirements


 
I hope you will enjoy the articles and hopefully eagerly await the next issue of "The Emulation Scene"


Yours truly
KuRIoS – on behalf of the MMOwned staff and the Emulator Experts group

Credits:
Hellgawd
Stoneharry
GastricPenguin
2dgreengiant

----------


## KuRIoS

Patch 3.1 - The Race to the Finish!

Written by Hellgawd

With Blizzard's highly anticipated patch, 3.1 (bringing Ulduar, many UI changes, and so much more fun stuff) revolutionized itself across the Emulation world. As always with every new patch, the Emulator to first support the new patch wins a lot of user support until the next patch rolls around. This time, the 'up and coming' Emulator, AspireDev's very own Hearthstone Emulator, managed to crank out 3.1 support before anyone else, which satiated many appetites. However, writhed with glitches and other downfalls, many users looked for an alternative which was found later with Mangos, the longest running single Emulator, who released 3.1 about a week after Hearthstone did.

ArcEmu, which many here at MMOwned prefer for their emulation purposes, still to this date hasn't released their 3.1 core yet, however their 3.0.9 core could possibly be said to be the best 3.0.9 open sourced emulator available at the moment. Internal developers of ArcEmu have leaked that they will be supporting 3.1 sometime in the coming week(s), so your wait will be almost over! AspireDev still hasn't updated their 3.1 branch, leaving it sit in their SVN repository. All of their efforts are aimed at their 3.0.9 branch, and it is unsure when they will fix up the many bugs of their 3.1 core. And don't forget - Blizzard has already revealed their patch 3.2 plans, so private servers will be going through a hard patch soon.

What does this mean for MMOwned members? In general, just expect a few more bugs and not so much from your core developers. Perhaps some more patience with those that give their free time to work on the core you prefer? Maybe donate to those projects you already support with comments and feedback? I have a hunch that some projects might just close their doors in the following few weeks, so hasten on, it's going to be a rough ride!

----------


## KuRIoS

Lua
Written by Stoneharry

 What is Lua?




> Lua is a powerful, fast, lightweight, embeddable scripting language.


Where does the name originate from and how do you pronounce it?



> "Lua" (pronounced *LOO-ah*) means "Moon" in Portuguese. As such, it is neither an acronym nor an abbreviation, but a noun. More specifically, "Lua" is a name, the name of the Earth's moon and the name of the language. Like most names, it should be written in lower case with an initial capital, that is, "Lua". Please do not write it as "LUA", which is both ugly and confusing, because then it becomes an acronym with different meanings for different people. So, please, write "Lua" right!


What are the different Lua engines?

GuaEngine:

GuaEngine (Gastricpenguin's Lua Engine) is a custom Lua engine designed to integrate more lua commands and add support for new features. There are only a few custom lua engines out there; the sad part is that they are updated once in a millennium or are outdated. The GuaEngine is compatible with the latest Ascent-Branch emulators and is updated frequently.
http://www.mmowned.com/forums/emulat...ua-engine.html

GuaEngine - Revision 24: /

LuAppArc

LuAppArc is a Lua engine focused on ArcEmu trying to get every single default command working. They are constantly trying to provide the service for the community and rarely have problems.

Log In

LUAppArc - Revision 5: /

Sun++

Sun++ is a Lua engine and scripting project which has been around far longer than the others. They are often outdated but they try there best and focus on support for Aspire.
AspireDev.org - Login
sunplusplus - Revision 854: /

So how does Lua work exactly?
 
Lua works in functions. Each function must start by defining what it is and then doing what you want to do, and to finnaly end it. This is similer to many other sytems you may have heard of, such as "Input, proccess and output".
With each function you must tell the Lua engine when you want to do it. You do this by registering it, you can register each function outside the script (by on combat etc) or inside the script (continuing on from the current object).
If something is not functioned, the Lua engine will try to load it when the script loads. For example if you just put in a print function:




> print("Hello World")




Then all you will get is when the console gets to the script it will tell you it loaded then display:




> Hello World




People use this to display trademarks and instructions.
Also note that Lua loads in alphabetical order, meaning that if a script is named zzzHello it will be one of the last ones to load, or if it is called aaaHi, it will be one of the first to load. This helps when debugging.

http://www.mmowned.com/forums/emulat...-tutorial.html
http://www.mmowned.com/forums/emulat...-advanced.html

The official Lua-wiki:
lua-users wiki: Lua Directory

What can be done using Lua?

 The possibilites of Lua is endless:

-You can use it to create items, creatures, gameobjects and anything really in the database using the execute query function.
-You can create simple or advanced boss fights.
-You can spawn creatures, make traps, and gossip npcs ranging from vendors to flight paths for the more advanced.
-You can use items and gameobjects to teleport you and cast spells.
-You, can do almost anything at the end of the day.

Of course this is just for in-game.
Outside it is used in almost every addon you find, and real life matters.
Blizzard even use Lua as it is one of the requirements for some of their jobs involving WoW.

Why use Lua over C++?

Well to be quite frank, Lua is easier. With Lua you can edit a script and put it on the server with two clicks of a button. With C++ you will need to recompile it. With Lua everything can be done in one file, and anyone can view and edit it easily. With C++ everything is saved into a dll and the solution is multiple files, which makes editing quite hard. Lua is far more easier than C++ to script in for begginers. You can make a script for a simple npc that you want to talk in five minutes in Lua, for C++ it would take at least double that time. Lua makes your life easy, good for the lazy.

----------


## KuRIoS

*Beyond the Teleporter
A look at C++ scripting Written by GastricPenguin
* 
Gossip scripts here on MMOwned are everywhere. There are plenty of guides and releases that detail how you can create your very own NPC 
teleporter. The thing they don't tell you is that teleporters are not the only thing that can be accomplished by writing a C++ script. Why, a 
gossip script can be used for anything you can think of. How does an Item that checks your current position, and if you are within a certain 
pre-defined range launches you up into the air, sound? What about an NPC that heals you when you shout "Help!"? There's hardly a limit you 
could reach (within reason) when creating a C++ script. Enough of the talk however, let's see some demonstrations!

Demonstration of a non-teleporter item script
[yt]<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/V5F8X93aJBU&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/V5F8X93aJBU&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>[/yt]

Demonstration of a script using a chat hook:
[yt]<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/ytC5B-zT6sA&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ytC5B-zT6sA&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>[/yt]

Pretty cool, huh? The best part is that these scripts are very small and easy to write. Let's take a look at the first script.



```
//COMPATIBLE WITH THE ASPIRE CORE ONLY
#include "StdAfx.h"
#include "Setup.h"
#define BLIGHT_EXPLOSION 61126
#define LAUNCH 16716
#define SUICIDE 7
//This is a class that is called after the item is activated
//We have it at the top so the shared_ptr<Aftermath> can be used without errors
//'public EventableObject' is also needed for the shared_ptr
class Aftermath : public EventableObject
{
public:
    void Explode(PlayerPointer Plr)
    {
        Plr->CastSpell(Plr, BLIGHT_EXPLOSION, 0);
        //Fun spell for visuals (does cause high damage to opponents if in combat)
        Plr->CastSpell(Plr, SUICIDE, 0);
        //Kills the player (for lack of a better way)
    }
};

class SCRIPT_DECL Launcher : public GossipScript
{
public:
    void GossipHello(ObjectPointer pObject, PlayerPointer Plr, bool AutoSend)
    {
    shared_ptr<Aftermath> am;
    //opens a shared ptr for the Aftermath class
    Plr->CastSpell(Plr, LAUNCH, 0);
    //Launch the player sky-high
    TimedEvent *te = TimedEvent::Allocate(am, new CallbackP1<Aftermath, PlayerPointer>(am, &Aftermath::Explode, Plr), 0, 2950, 1);
    sWorld.event_AddEvent(te);
    //Add a timed event to kill the player 3 seconds later. This TimedEvent calls void Explode() in the Aftermath class after (roughly) 3 seconds
    }
    void GossipEnd(ObjectPointer pObject, PlayerPointer Plr)
    {
        GossipScript::GossipEnd(pObject, Plr);
    }
    void Destroy()
    {
        delete this;
    }
};

void SetupLauncher(ScriptMgr * mgr)
{
    GossipScript * gs = (GossipScript*) new Launcher();
    mgr->register_item_gossip_script(44560, gs);
}
```

It may be intimidating to look at, but I assure you it is a very simple concept. Just read the commented lines for more information about what is 
going on in the script. The second script looks as such: (again, refer to the comments for more information)



```
//COMPATIBLE WITH THE ASPIRE CORE ONLY
#include "StdAfx.h"
#include "Setup.h"
#define ETERNAL_AFFECTION 30878
using namespace std;
//Why use the std namespace? We are working with strings, that's why!

bool OnChat(PlayerPointer pPlayer, uint32 Type, uint32 Lang, string Message, string Misc)
{
    string input = Message;
    //Here we make a copy of the chat message so we can mess with it
    transform(input.begin(), input.end(), input.begin(), tolower);
    //This function takes the new copy and converts all characters to lowercase
    if(strstr(input.c_str(), "i need healing"))
    //if "i need healing" has been said, we continue!
    {
        CreaturePointer Healer = 
            pPlayer->GetMapMgr()->GetInterface()->SpawnCreature(50016, pPlayer->GetPositionX(),
            pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 0, true, false, 0, 0);
        //Let's spawn us a healer! The next 4 lines are easy to understand

        Healer->SendChatMessage(12, 0, "I'm here to help!");
        Healer->CastSpell(pPlayer, ETERNAL_AFFECTION, 0);
        Healer->Despawn(5000, 0);
    }
    return true;
}

void SetupChatHealer(ScriptMgr * mgr)
{
    mgr->register_hook(SERVER_HOOK_EVENT_ON_CHAT, OnChat);
}
```

*Why do people neglect writing scripts in C++?*

For some reason, people believe that their precious Lua script can do anything they want. Although 
that is entirely false, I believe that the main reason why people do not prefer a C++ script is the fact they are introduced to the language 
incorrectly. Most C++ guides here on MMOwned are directed towards writing teleporters (aside from mager who released that lovely creature 
structure here). Teleporters may be fun and all, but gossip scripts are intimidating. An average C++ Gossip Script ranges from 100 to 150 lines 
of code! That is way too much to be looking at for a novice, no matter how well you write the guide. My advice for those out there who have 
been introduced to C++ in the wrong light, start off with something small like a simple hook. C++ is a very versatile language that can be your best 
friend when you get the hang of things!

----------


## KuRIoS

New Emulation Expert requirements
Written by 2dgreengiant

Ok well for this article i would like to add the new emulation expert requirements. This counts for _ALL_ people unless a big exception is made.

*Requirements:*

You have a minimum of 20 reputation.Have a method of communication (msn/aim).Must be *mature*
Proper use of grammar and Mechanics.You show commitment to the team e.g. you don't just get the title and laze off.
You own, or have created a private server.Been apart of a database, core or addon development team (proof required).You know the basics of the following languages: SQL : C++ : LUAMust be active in the following emulation sections.: questions, discussion and releases

Do not apply to be in the Emu Expert group if you do not meet these requirements. Be honest to yourself.

Samples of what you know will be required such as a C++ spel lfix script or a LUA script (not a teleporter or simpel boss fight). You will under go a range of extensive questions between both GastricPenguin and 2dgreengiant when a final vote will be cast between the current emulation experts.

----------


## Hellgawd

Overall it looks good, great work guys + KuR  :Big Grin:

----------


## ZestyJ

Very Nice. Well thought out and organized. EMU FTW!

----------


## Vindicated

In general, I approve. Nice work guys  :Wink:

----------


## Linkn

Very nice, Gastric's scripts are awesome! I think I'll take the advice and attempt to learn c++ again..

----------


## Hunterplay

Very nice.Liked hell gawds post

----------


## Xel

This thread is amazing, thanks all!

----------


## Cykro

Wow, all that info is great, thanks every1 that worked on it
I think ill attempt Lua first as i am kind of lazy^^

----------


## Claiver

I agree, I will be so much more focussing on the new requirements, off we go then!
Nice written articles all, good job!

----------


## Koleo

> Our Emulation Experts is doing monthly updates


You should say 'are' if your speaking in the plural so it should be:
Our Emulation Experts are doing monthly updates

----------


## stoneharry

> You should say 'are' if your speaking in the plural so it should be:
> Our Emulation Experts are doing monthly updates


The Grammer Police have arrived  :Stick Out Tongue:

----------


## MasterGold

Epic  :Smile:  I just can't seem to find out what the purpose at the C++ is.

----------


## obox

> Epic  I just can't seem to find out what the purpose at the C++ is.


scripts done in c++ are more accuarate and less buggy

----------


## stoneharry

> scripts done in c++ are more accuarate and less buggy


Not always true.. It depends on the quality of the script  :Stick Out Tongue:  All can be equally good.
What is true is that in C++ far more can be done and there is more controll over each event. There is no limit to C++ at the end of the day while in other languages in emulation you are limited to the commands you are given till you make custom ones.

----------


## Vragoth

People generally prefer lua over C++ since lua is much easier to script and understand. C++ takes more time and effort to learn. Lua is great! But once you master Lua, you should move on to C++. If you find C++ hard try going for C,C+. Choose one of those first.

----------


## KuRIoS

> You should say 'are' if your speaking in the plural so it should be:
> Our Emulation Experts are doing monthly updates


who the **** cares?

----------


## mager1794

> (aside from mager who released that lovely creature 
> structure here)




Yay!!!! i feel special <3.......lol sorry i like to feel like im wanted XD

----------


## AzolexX

> People generally prefer lua over C++ since lua is much easier to script and understand. C++ takes more time and effort to learn. Lua is great! But once you master Lua, you should move on to C++. If you find C++ hard try going for C,C+. Choose one of those first.


Btw, to say C+++ scripts are best so you can try learning it after C++!

----------


## Henkke

> Patch 3.1 - The Race to the Finish!
> This time, the 'up and coming' Emulator, AspireDev's very own Hearthstone Emulator, managed to crank out 3.1 support before anyone else, which satiated many appetites.


Wrong. MaNGOS had 3.1 support when it still was in PTR, way before Hearthstone had, that crew just copy&pasted whole 3.1 changes from mangos to their emulator, so this statement is not true.

You can check all the 3.1 changes and compare them against mangos 310 git branch, the git branch had them way before.

----------


## KuRIoS

edited ur reply as i didnt write it  :Smile:  We dont want any emu bashing in this thread, it will result in deletion -> infractions -> Ban

----------


## Henkke

Im not here to bash any emulators, but to keep them equal. Since currently the subpart 
"Patch 3.1 - The Race to the Finish!"
Is pretty much hearthstone/arcemu fanboy writing, where most parts arent even true. 
Like
"however their 3.0.9 core could possibly be said to be the best 3.0.9 open sourced emulator available at the moment."

Big amount of people would rank it to be the worst 3.0.9 supporting os emulator.  :Wink:  

And offcourse that 3.1 part, which is not true in any case.

I understand that it's hard to write an objective writing about wow emulation, or anything where you have many choices, and are a user yourself. Just like comparing windows and linux. If your a linux user, it rocks socks, windows sucks. But if your windows user, its the opposite.

This is where most of the "Wow emulation history, ascent vs mangos, etc" threads here in mmowned fail, the writer is a fanboy / user of one of them, and the whole writing is based on that fact. So it ends up being a opinion writing of some, and if an outsider reads it, he gets the way wrong impression on how the things really are.

----------


## AzolexX

Oki, oh btw to all that C+ thing is for me irony, ':Nightmare:', there is no such thing as 'C+'.

----------


## mager1794

There is too!!!!!!!!

you just gotta be more openminded AxolexX just let your imagination wonder and you'll find it lol =D

----------


## AzolexX

Actually thing of C+- or C+ is not programing lang....go google it and find out what it is(Yes it is something related to C/C++...but what?

----------


## KuRIoS

> Im not here to bash any emulators, but to keep them equal. Since currently the subpart 
> "Patch 3.1 - The Race to the Finish!"
> Is pretty much hearthstone/arcemu fanboy writing, where most parts arent even true. 
> Like
> "however their 3.0.9 core could possibly be said to be the best 3.0.9 open sourced emulator available at the moment."
> 
> Big amount of people would rank it to be the worst 3.0.9 supporting os emulator.  
> 
> And offcourse that 3.1 part, which is not true in any case.
> ...


Henkke, it was more of an explanation as to why your post from earlier was deleted, it was in a mess of fanboibashing posts.

----------


## Henkke

KuRIoS: Yea kinda suspected that, it was in middle of 5 totally offtopic posts.

Now we just got to wait for hellagawd to check this thread and hopefully he'l rewrite that 3.1 post a bit to make it more correct.  :Smile:

----------


## faculty1

Wow, all that info is great, thanks every1 that worked on it

----------


## Aircon

Pure win. But tbh I was staring at Kurios's Avatar half the time.

----------


## Fireblast

very nice, hope emulation will survive for 3.2(;

----------


## Hellgawd

June Issue should be coming out soon!  :Wink:

----------


## stoneharry

> very nice, hope emulation will survive for 3.2(;


There are no changes in 3.2 that will be hard for emulaters to overcome, in 3.1 a hell of a lot changed.

Edit: Thats wrong, ignore my statement  :Smile:  Learnt from when I posted in emulater discussions  :Stick Out Tongue:

----------


## AzolexX

WTF? 3.1 did not change lot stuff, it is not problem to get it working, just packet encrypt and few interface stuff....all other stuff are emu features...

----------

