[Lua-C++]Full Event System

09/25/2016 10:14 MrLibya#1
Hallo All

i've been basy for while of time ( away from metin2 ) and i'm now start thinking in leave it for ever :)

so i will share with u my event system

what is include ?

Event.quest ( for start / close events )
event_drop.quest ( for drops items from monster/boss/stone) for all event


[ event.quest ]

[ event.quest - Untested ]



[ events_drop.quest ]


[quest_lib.lua]

source part :

add in questlua_npc

PHP Code:

int npc_get_type0
(lua_State * L)
    {
        
CQuestManager& q = CQuestManager::instance();
        
LPCHARACTER npc = q.GetCurrentNPCCharacterPtr();
        if (
npc)
        {
            if(
npc->IsMonster())
                
lua_pushnumber(L, 1);
            else if ( 
npc->IsStone())
                
lua_pushnumber(L, 2);
        }
        else
            
lua_pushnumber(L, 0);
        return 
1;
    } 


For who not know, the system makes easy to add new event , with no limit of items , that mean u don't need to edit anything in the quest code to add new items for the event , just add in the event field the items id and the quest will auto read how much items u put there