Jump to content

stiflerxx

Members
  • Content Count

    125
  • Joined

  • Last visited

Posts posted by stiflerxx


  1. Hello Hercules Community,

     

    I am offering my Services to you @ some expense of money.

     

    Services:

    [*]Scripting. (Min Price: 5$, Maximum Price: Depends on Complexity)

    [*]Source Modification(/Addition). (Min Price: 5$, Maximum PriceDepends on Complexity)

    [*]Converting to/Creating a Plugin. ( Price Depends on Plugin Complexity)

    [*]Migrating Your Server. (5$ Fixed Price)

    [*]Adding Custom Items/Maps/Mobs. (Depends on Amount of things to add)

    [*]Creating/Adding New Skills. (Depends on the Skill Complexity)

    [*]Changing of Emulator (Depends on how much mods you have)

    [*]ClientSide Things.

    [*]Fixing Errors.

    [*]And Anything else, that you want, just drop me a PM

    What Else:

    [*]Free Support for Service bought from me.

    [*]You should have patience till I complete your service.

    [*]Quality Work.

    Contact Info:

    [*]Post Here

    [*]Via PM

    Payment Methods:

    [*]PayPal Only

    [*]Western Union

    [*]PM me if you want any other payment method, and I might check If I can have it.

    Status: UnAvailable(Maybe drop me a PM, who knows if I am available that day)

     

    Some Paid Script Request and Progress:

    Scripts:

    1)Orb Enchanter NPC (Script)

    2)Forging NPC (Script+Source)

    3)All in One Event Manager (Script)

    4)RankingSystem (Script+Source)

    5)Coupon System (Script)

    6)Login Rewarder (Script)

    7)Buff via chat (Script)

    8)Credit Exchanger (Script)

    9)Player Floating Rate (Script)

    10)GM Login Protection (Script)

    11)Gold Room w/ Bot Checker (Script)

    12)Identify NPC (Script)

    13)MOTD Edits (Script)

    14)PvP/MvP Rankings with Reward (Script)

    15)Open Sell Shop via command(@sell) (Script)

    16)Ticket System (Script)

     

    Source:

    1)BG Flavius CTF (Source Edit to support eAmodBG in hercules)

    2)Faction System (Script+Source)

    3)MonsterVsMonster (Script+Source)

    4)itemmap Modification (Source)

    5)Reject Sword(Skill) Modification (Source)

     

    PHP Scripts:

    1)Vote For Points Modification

     

    [*]Source Modification(/Addition). (Min Price5$Maximum PriceDepends on Complexity)//

    [*]Fixing Errors.

     

    is available?

    how much to fix these warnings in src?

     

     skill.c: In function 'skill_delay_check':
    skill.c:14507: warning: suggest parentheses around assignment used as truth value
    skill.c:14507: warning: suggest explicit braces to avoid ambiguous 'else'
    skill.c:14515: warning: suggest parentheses around assignment used as truth value
    skill.c:14515: warning: suggest explicit braces to avoid ambiguous 'else'

     

    npc.c:4021:71: warning: character constant too long for its type
    npc.c: In function 'npc_parse_mapflag':
    npc.c:4021: warning: comparison is always true due to limited range of data type
     
    harmony.c: In function 'harmony_action_request':
    harmony.c:382: warning: format '%s' expects type 'char *', but argument 2 has type 'intptr'

     

     


  2.  

    No Delay Grf Protection

     

     

     

    NDG Protection is a src modification to make sure NDG,speed hack, WPE Users still follow the rules.

     

    History:

    This is a simple code, which we have made since long to minimize the NDG User.

    The first way to solve NDG, we add a cooldown for skills that dosn't has a fixed cooldown (Sonic Blow, Cross Impact, etc).

    But the player doesn't allowed to do double cast.

    Finaly we made this code that minimize the NDG users, but still keep the original feature that is double cast for some skills (Sonic Blow, Cross Impact, etc).

     

    Implementation:

    1. Download 2 files above
    2. Use manual way to diff (first file) the core and recompile.
    3. Copy Paste the second file to "conf/import/"
    4. And you will see the effect :)

     

     

    Feature:

    -The user still able to use double SB / CI / etc.

    -You may switch on and off.

    -Very simple

     

     

    Any comments, suggestions, even critism in order to make this feature better is opened.

    Thank You.

     

     

    Note:

     I've been testing NoDelayGrf on augst 2013 and doesn't work,

     i've tested this using WPE

     i've got the numbers from comparing with and without *cheat

     

     

    DOWNLOAD

    src:

    attachicon.gifHerc - NDG Protection.diff

    import/

    attachicon.gifbattle_conf.txt

    skill.c: In function 'skill_delay_check':
    skill.c:14507: warning: suggest parentheses around assignment used as truth value
    skill.c:14507: warning: suggest explicit braces to avoid ambiguous 'else'
    skill.c:14515: warning: suggest parentheses around assignment used as truth value
    skill.c:14515: warning: suggest explicit braces to avoid ambiguous 'else'
     
    help?

  3. olá eu baixei o emulador e botei o diff deste topico>>> http://herc.ws/board/topic/3267-harmony-patch-3312-30-mai/

     

    o emulador ta ligando normal e estou logando normal mais tem alguns erros como

     

    se eu por @at e depois desligar o emulador quando vou tentar ligar de novo ele da os arros e dca cache no map-server:


     

     

    [Debug]: at loginlog_sql.c:81 - self is NULL
    [Error]: timer_do_delete error : function mismatch (nil)(unknown timer function) != 0x40f360(ipban_cleanup)
    [Debug]: at ipban_sql.c:259 - self is NULL

     

    [Fatal Error]: map_setipport : received info that this map-server SHOULD have map 'alb_ship', but it is not loaded.

    [Fatal Error]: map_setipport : received info that this map-server SHOULD have map 'alb_ship', but it is not loaded.

     

    lembrando que alb_ship não e mapa custom! e um mapa que já vem com o emulador.

     

    at loginlog_sql linha 61 a 82(onde ta o 1° erro toda função):

     

    /*=============================================
    * Records an event in the login log
    *---------------------------------------------*/
    void login_log(uint32 ip, const char* username, int rcode, const char* message, const char* mac)
    {
    char esc_username[NAME_LENGTH*2+1];
    char esc_message[255*2+1];
    int retcode;

    if( !enabled )
    return;

    SQL->EscapeStringLen(sql_handle, esc_username, username, strnlen(username, NAME_LENGTH));
    SQL->EscapeStringLen(sql_handle, esc_message, message, strnlen(message, 255));

    retcode = SQL->Query(sql_handle,
    "INSERT INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`,`mac`) VALUES (NOW(), '%s', '%s', '%d', '%s', '%s')",
    log_login_db, ip2str(ip,NULL), esc_username, rcode, esc_message, mac);

    if( retcode != SQL_SUCCESS )
    Sql_ShowDebug(sql_handle);
    }

     

     

    at login/ipban_sql.c linhas 253 a 262

     

     

    // remove expired bans
    int ipban_cleanup(int tid, int64 tick, int id, intptr_t data) {
    if( !login_config.ipban )
    return 0;// ipban disabled

    if( SQL_ERROR == SQL->Query(sql_handle, "DELETE FROM `%s` WHERE `rtime` <= NOW()", ipban_table) )
    Sql_ShowDebug(sql_handle);

    return 0;
    }

     

     

     

    tenha um bom dia e obg a todos.

     


  4.  

    Você deve usar o Visual 12 para compilar o hercules nesse caso.

     

    Nada haver uso o 2013 e compilo normal, alguma alteração na src.

    Baixa novamente e faça a compilação rsrs

    eu to baixando a do github eu só baixo extraio e clico em compilar '=' uso o 2013 e pra compilar eu clico no 12 mais acho que n e isso '-'


  5. UPDATE

     

    Hercules Harmony Patch - 30 MAI

     

    updated the FULL Patch to V5 , Fully work with the latest Hercules REV.

     

     

    Dropped the Small Fix Patch....

     

     

    the Patch can be found on the First Site of this Topic...

    hello no more as this part should I replace?

     

     

    Index: Hercules-10.sln

     

    -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "plugin-HPMHooking", "vcproj-10plugin-HPMHooking.vcxproj", "{E64C56D3-CDFB-483B-900B-A62D216B6D2F}"

    +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "plugin-HPMHooking", "vcproj-10plugin-HPMHooking.vcxproj", "{7ED92B9F-95E8-49B8-9D4F-C4C9BFDE0B22}"

     

     

     

     

    Index: vcproj-10/char-server.vcxproj
    ===================================================================
    --- vcproj-10/char-server.vcxproj (revision 14262)
    +++ vcproj-10/char-server.vcxproj (working copy)
    @@ -173,6 +173,7 @@
         <ClInclude Include="..srccharinter.h" />
         <ClInclude Include="..srccharpincode.h" />
         <ClInclude Include="..srccommonwinapi.h" />
    + <ClInclude Include="..srccommonharmony.h" />
       </ItemGroup>
       <ItemGroup>
         <ClCompile Include="..3rdpartylibconfiggrammar.c" />
    @@ -213,6 +214,7 @@
         <ClCompile Include="..srccharint_storage.c" />
         <ClCompile Include="..srccharinter.c" />
         <ClCompile Include="..srccharpincode.c" />
    + <ClCompile Include="..srccommonharmonycore.c" />
       </ItemGroup>
       <Import Project="$(VCTargetsPath)Microsoft.Cpp.targets" />
       <ImportGroup Label="ExtensionTargets">
    Index: vcproj-10/login-server.vcxproj
    ===================================================================
    --- vcproj-10/login-server.vcxproj (revision 14262)
    +++ vcproj-10/login-server.vcxproj (working copy)
    @@ -166,6 +166,7 @@
         <ClInclude Include="..srccommontimer.h" />
         <ClInclude Include="..srccommonutils.h" />
         <ClInclude Include="..3rdpartymt19937armt19937ar.h" />
    + <ClInclude Include="..srccommonharmony.h" />
       </ItemGroup>
       <ItemGroup>
         <ClCompile Include="..3rdpartylibconfiggrammar.c" />
    @@ -197,6 +198,7 @@
         <ClCompile Include="..srccommontimer.c" />
         <ClCompile Include="..srccommonutils.c" />
         <ClCompile Include="..3rdpartymt19937armt19937ar.c" />
    + <ClCompile Include="..srccommonharmonycore.c" />
       </ItemGroup>
       <Import Project="$(VCTargetsPath)Microsoft.Cpp.targets" />
       <ImportGroup Label="ExtensionTargets">
    Index: vcproj-10/map-server.vcxproj
    ===================================================================
    --- vcproj-10/map-server.vcxproj (revision 14262)
    +++ vcproj-10/map-server.vcxproj (working copy)
    @@ -160,6 +160,7 @@
         <ClInclude Include="..srccommontimer.h" />
         <ClInclude Include="..srccommonutils.h" />
         <ClInclude Include="..srccommonwinapi.h" />
    + <ClInclude Include="..srccommonharmony.h" />
         <ClInclude Include="..srcmapatcommand.h" />
         <ClInclude Include="..srcmapbattle.h" />
         <ClInclude Include="..srcmapbattleground.h" />
    @@ -205,6 +206,7 @@
         <ClInclude Include="..srcmaptrade.h" />
         <ClInclude Include="..srcmapunit.h" />
         <ClInclude Include="..srcmapvending.h" />
    + <ClInclude Include="..srcmapharmony.h" />
       </ItemGroup>
       <ItemGroup>
         <ClCompile Include="..3rdpartylibconfiggrammar.c" />
    @@ -235,6 +237,7 @@
         <ClCompile Include="..srccommonthread.c" />
         <ClCompile Include="..srccommontimer.c" />
         <ClCompile Include="..srccommonutils.c" />
    + <ClCompile Include="..srccommonharmonycore.c" />
         <ClCompile Include="..srcmapatcommand.c" />
         <ClCompile Include="..srcmapbattle.c" />
         <ClCompile Include="..srcmapbattleground.c" />
    @@ -274,6 +277,7 @@
         <ClCompile Include="..srcmaptrade.c" />
         <ClCompile Include="..srcmapunit.c" />
         <ClCompile Include="..srcmapvending.c" />
    + <ClCompile Include="..srcmapharmony.c" />
       </ItemGroup>
       <Import Project="$(VCTargetsPath)Microsoft.Cpp.targets" />
       <ImportGroup Label="ExtensionTargets">
     

  6. bom eu só baixei e tentei compilar e já deu erro '-'

    uso o visual 2013 completo. e tentei compilar no v12 do hercules.

     

    o erro e esse:

    c0KNcqY.png

     

    bom eu mesmo nem configurei nada só extrai do zip que baixei no github do hercules e cliquei pra compilar...

     

    me fale como corrigir pq antes de mexer queria que pelo mesmo n tive-se erros sem nem mesmo ter editado nada.

     

    postei no geral PT-br pq no report bug teria que escrever em inglês e não sou bom ai teria que usar o translator ai ficaria pior kkk

     

     

    abç.


  7. someone help me make this diff harmony compatible with Hercules?

     

     

    src/char/char.c | 28 +++++++++++++++++
    src/common/Makefile.in | 4 +--
    src/common/core.c | 6 ++++
    src/common/mmo.h | 7 +++++
    src/common/socket.c | 14 +++++++++
    src/common/socket.h | 2 ++
    src/login/account.h | 4 +++
    src/login/account_sql.c | 35 +++++++++++++++++++--
    src/login/login.c | 81 +++++++++++++++++++++++++++++++++++++++++++-----
    src/login/login.h | 3 ++
    src/login/loginlog.h | 2 +-
    src/login/loginlog_sql.c | 6 ++--
    src/map/Makefile.in | 4 +--
    src/map/atcommand.c | 5 +++
    src/map/chrif.c | 20 ++++++++++++
    src/map/chrif.h | 2 ++
    src/map/clif.c | 6 +++-
    src/map/map.c | 5 +++
    src/map/packets.h | 1 +
    src/map/pc_groups.c | 21 +++++++++++++
    src/map/pc_groups.h | 2 ++
    src/map/script.c | 3 ++
    22 files changed, 242 insertions(+), 19 deletions(-)

    diff --git a/src/char/char.c b/src/char/char.c
    index 824c782..7ff01ce 100644
    --- a/src/char/char.c
    +++ b/src/char/char.c
    @@ -2423,6 +2423,17 @@ int parse_fromlogin(int fd) {
    session[fd]->flag.ping = 0;
    break;

    + // Harmony
    + case 0x40a3:
    + if (RFIFOREST(fd) < 4 || RFIFOREST(fd) < RFIFOW(fd,2))
    + return 0;
    + {
    + RFIFOW(fd, 0) = 0x40a4;
    + mapif_sendall(RFIFOP(fd, 0), RFIFOW(fd,2));
    + }
    + RFIFOSKIP(fd, RFIFOW(fd,2));
    + break;
    +
    // changesex reply
    case 0x2723:
    if (RFIFOREST(fd) < 7)
    @@ -3590,6 +3601,23 @@ int parse_frommap(int fd)
    RFIFOSKIP(fd,10);
    break;

    + case 0x40a1: // Harmony
    + {
    + uint16 len;
    +
    + if (RFIFOREST(fd) < 4 || RFIFOREST(fd) < (len = RFIFOW(fd,2)))
    + return 0;
    +
    + if (login_fd > 0) {
    + WFIFOHEAD(login_fd,len);
    + WFIFOW(login_fd, 0) = 0x40a2;
    + memcpy(WFIFOP(login_fd, 2), RFIFOP(fd, 2), len-2);
    + WFIFOSET(login_fd, len);
    + }
    +
    + RFIFOSKIP(fd, len);
    + }
    +
    case 0x2b1a: // Build and send fame ranking lists [DracoRPG]
    if (RFIFOREST(fd) < 2)
    return 0;
    diff --git a/src/common/Makefile.in b/src/common/Makefile.in
    index 5dfdd35..2ce8e50 100644
    --- a/src/common/Makefile.in
    +++ b/src/common/Makefile.in
    @@ -20,7 +20,7 @@ MT19937AR_INCLUDE = -I$(MT19937AR_D)

    COMMON_SHARED_C = conf.c db.c des.c ers.c grfio.c HPM.c mapindex.c md5calc.c
    mutex.c nullpo.c random.c showmsg.c strlib.c sysinfo.c
    - thread.c timer.c utils.c
    + thread.c timer.c utils.c harmonycore.c
    COMMON_C = $(COMMON_SHARED_C)
    COMMON_SHARED_OBJ = $(patsubst %.c,%.o,$(COMMON_SHARED_C))
    COMMON_OBJ = $(addprefix obj_all/, $(COMMON_SHARED_OBJ)
    @@ -30,7 +30,7 @@ COMMON_MINI_OBJ = $(addprefix obj_all/, $(COMMON_SHARED_OBJ)
    COMMON_C += console.c core.c malloc.c socket.c
    COMMON_H = atomic.h cbasetypes.h conf.h console.h core.h db.h des.h ers.h
    grfio.h HPM.h HPMi.h malloc.h mapindex.h md5calc.h mmo.h mutex.h
    - nullpo.h random.h showmsg.h socket.h spinlock.h sql.h strlib.h
    + nullpo.h random.h showmsg.h harmony.h harmserv.h socket.h spinlock.h sql.h strlib.h
    sysinfo.h thread.h timer.h utils.h winapi.h

    COMMON_SQL_OBJ = obj_sql/sql.o
    diff --git a/src/common/core.c b/src/common/core.c
    index 99dbc36..d649941 100644
    --- a/src/common/core.c
    +++ b/src/common/core.c
    @@ -30,9 +30,11 @@
    # include "../common/sql.h"
    # include "../common/thread.h"
    # include "../common/timer.h"
    +#include "../common/harmony.h"
    # include "../common/utils.h"
    #endif

    +
    #ifndef _WIN32
    # include
    #else
    @@ -248,6 +250,8 @@ int main (int argc, char **argv) {

    sockt->init();

    + harmony_core_init();
    +
    do_init(argc,argv);
    {// Main runtime cycle
    int next;
    @@ -257,6 +261,8 @@ int main (int argc, char **argv) {
    }
    }

    + harmony_core_final();
    +
    console->final();

    retval = do_final();
    diff --git a/src/common/mmo.h b/src/common/mmo.h
    index ff7c1da..68409e2 100644
    --- a/src/common/mmo.h
    +++ b/src/common/mmo.h
    @@ -331,6 +331,13 @@ struct storage_data {
    struct item items[MAX_STORAGE];
    };

    +#ifdef HARMSW
    + #undef HARMSW
    +#endif
    +#define HARMSW HARMSW_RATHENA_GROUP
    +#define HARM_HERCULES
    +#define HARMONY_USE_POINTLESS_OOP_INTERFACE
    +
    struct guild_storage {
    int dirty;
    int guild_id;
    diff --git a/src/common/socket.c b/src/common/socket.c
    index c57cba3..811cedd 100644
    --- a/src/common/socket.c
    +++ b/src/common/socket.c
    @@ -21,6 +21,7 @@
    #include "../common/showmsg.h"
    #include "../common/strlib.h"
    #include "../common/timer.h"
    +#include "../common/harmony.h"

    #ifdef WIN32
    # include "../common/winapi.h"
    @@ -374,6 +375,9 @@ int recv_to_fifo(int fd)
    return 0;
    }

    + if (!session[fd]->flag.server)
    + len = harm_funcs->net_recv(fd, session[fd]->rdata + session[fd]->rdata_size, len, session[fd]->rdata, session[fd]->rdata_size + len);
    +
    session[fd]->rdata_size += len;
    session[fd]->rdata_tick = sockt->last_tick;
    #ifdef SHOW_SERVER_STATS
    @@ -489,6 +493,11 @@ int connect_client(int listen_fd) {
    create_session(fd, recv_to_fifo, send_from_fifo, default_func_parse);
    session[fd]->client_addr = ntohl(client_address.sin_addr.s_addr);

    + if (!harm_funcs->session_new(fd, session[fd]->client_addr)) {
    + sockt->close(fd);
    + return -1;
    + }
    +
    return fd;
    }

    @@ -630,6 +639,8 @@ static void delete_session(int fd)
    }
    if( session[fd]->hdata )
    aFree(session[fd]->hdata);
    + if (session[fd]->harm_sd)
    + harm_funcs->session_del(fd);
    aFree(session[fd]);
    session[fd] = NULL;
    }
    @@ -745,6 +756,9 @@ int WFIFOSET(int fd, size_t len)
    }

    }
    + if (!session[fd]->flag.server)
    + harm_funcs->net_send(fd, s->wdata+s->wdata_size, len);
    +
    s->wdata_size += len;
    #ifdef SHOW_SERVER_STATS
    socket_data_qo += len;
    diff --git a/src/common/socket.h b/src/common/socket.h
    index 42b0efe..941c4e2 100644
    --- a/src/common/socket.h
    +++ b/src/common/socket.h
    @@ -86,6 +86,8 @@ struct socket_data {

    uint32 client_addr; // remote client address

    + void *harm_sd;
    +
    uint8 *rdata, *wdata;
    size_t max_rdata, max_wdata;
    size_t rdata_size, wdata_size;
    diff --git a/src/login/account.h b/src/login/account.h
    index e15143c..b09a062 100644
    --- a/src/login/account.h
    +++ b/src/login/account.h
    @@ -23,6 +23,7 @@ struct mmo_account
    char pass[32+1]; // 23+1 for plaintext, 32+1 for md5-ed passwords
    char sex; // gender (M/F/S)
    char email[40]; // e-mail (by default: [email protected])
    + char mac_address[20]; // Harmony v3
    int group_id; // player group id
    uint8 char_slots; // this accounts maximum character slots (maximum is limited to MAX_CHARS define in char server)
    unsigned int state; // packet 0x006a value + 1 (0: complete OK)
    @@ -67,6 +68,9 @@ struct AccountDB
    /// @param self Database
    void (*destroy)(AccountDB* self);

    + /*** HARMONY v3 ***/
    + bool (*is_mac_banned)(AccountDB* self, const char *mac);
    +
    /// Gets a property from this database.
    /// These read-only properties must be implemented:
    /// "engine.name" -> "txt", "sql", ...
    diff --git a/src/login/account_sql.c b/src/login/account_sql.c
    index 10852e5..6f92395 100644
    --- a/src/login/account_sql.c
    +++ b/src/login/account_sql.c
    @@ -14,6 +14,7 @@
    #include "../common/malloc.h"
    #include "../common/mmo.h"
    #include "../common/showmsg.h"
    +#include "../common/harmony.h"
    #include "../common/socket.h"
    #include "../common/sql.h"
    #include "../common/strlib.h"
    @@ -78,6 +79,9 @@
    static bool mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int account_id);
    static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, bool is_new);

    +// Harmony
    +static bool account_db_sql_is_mac_banned(AccountDB* db, const char *mac);
    +
    /// public constructor
    AccountDB* account_db_sql(void)
    {
    @@ -94,6 +98,7 @@ AccountDB* account_db_sql(void)
    db->vtable.load_num = &account_db_sql_load_num;
    db->vtable.load_str = &account_db_sql_load_str;
    db->vtable.iterator = &account_db_sql_iterator;
    + db->vtable.is_mac_banned= &account_db_sql_is_mac_banned;

    // initialize to default values
    db->accounts = NULL;
    @@ -420,6 +425,27 @@ static bool account_db_sql_remove(AccountDB* self, const int account_id)
    return result;
    }

    +// Harmony
    +static bool account_db_sql_is_mac_banned(AccountDB* self, const char *mac) {
    + AccountDB_SQL* db = (AccountDB_SQL*)self;
    + Sql *db_handle = db->accounts;
    + SqlStmt* stmt = SQL->StmtMalloc(db_handle);
    +
    + bool result = false;
    +
    + if (SQL_SUCCESS != SQL->StmtPrepare(stmt, "SELECT 1 FROM mac_bans WHERE mac = ?") ||
    + SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, (void*)mac, strlen(mac)) ||
    + SQL_SUCCESS != SQL->StmtExecute(stmt)) {
    + Sql_ShowDebug(db_handle);
    + } else {
    + result = (SQL->NumRows(db_handle) > 0);
    + SQL->FreeResult(db_handle);
    + }
    + SQL->StmtFree(stmt);
    +
    + return result;
    +}
    +
    /// update an existing account with the provided new data (both account and regs)
    static bool account_db_sql_save(AccountDB* self, const struct mmo_account* acc)
    {
    @@ -540,7 +566,7 @@ static bool mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int acc

    // retrieve login entry for the specified account
    if( SQL_ERROR == SQL->Query(sql_handle,
    - "SELECT `account_id`,`userid`,`user_pass`,`sex`,`email`,`group_id`,`state`,`unban_time`,`expiration_time`,`logincount`,`lastlogin`,`last_ip`,`birthdate`,`character_slots`,`pincode`,`pincode_change` FROM `%s` WHERE `account_id` = %d",
    + "SELECT `account_id`,`userid`,`user_pass`,`sex`,`email`,`group_id`,`state`,`unban_time`,`expiration_time`,`logincount`,`lastlogin`,`last_ip`,`birthdate`,`character_slots`,`pincode`,`pincode_change`, `last_mac` FROM `%s` WHERE `account_id` = %d",
    db->account_db, account_id )
    ) {
    Sql_ShowDebug(sql_handle);
    @@ -569,6 +595,7 @@ static bool mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int acc
    SQL->GetData(sql_handle, 13, &data, NULL); acc->char_slots = (uint8)atoi(data);
    SQL->GetData(sql_handle, 14, &data, NULL); safestrncpy(acc->pincode, data, sizeof(acc->pincode));
    SQL->GetData(sql_handle, 15, &data, NULL); acc->pincode_change = (unsigned int)atol(data);
    + SQL->GetData(sql_handle, 16, &data, NULL); safestrncpy(acc->mac_address, data, sizeof(acc->mac_address));

    SQL->FreeResult(sql_handle);

    @@ -594,7 +621,7 @@ static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, boo
    if( is_new )
    {// insert into account table
    if( SQL_SUCCESS != SQL->StmtPrepare(stmt,
    - "INSERT INTO `%s` (`account_id`, `userid`, `user_pass`, `sex`, `email`, `group_id`, `state`, `unban_time`, `expiration_time`, `logincount`, `lastlogin`, `last_ip`, `birthdate`, `character_slots`, `pincode`, `pincode_change`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
    + "INSERT INTO `%s` (`account_id`, `userid`, `user_pass`, `sex`, `email`, `group_id`, `state`, `unban_time`, `expiration_time`, `logincount`, `lastlogin`, `last_ip`, `birthdate`, `character_slots`, `pincode`, `pincode_change`, `last_mac`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?)",
    db->account_db)
    || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_INT, (void*)&acc->account_id, sizeof(acc->account_id))
    || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, (void*)acc->userid, strlen(acc->userid))
    @@ -612,13 +639,14 @@ static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, boo
    || SQL_SUCCESS != SQL->StmtBindParam(stmt, 13, SQLDT_UCHAR, (void*)&acc->char_slots, sizeof(acc->char_slots))
    || SQL_SUCCESS != SQL->StmtBindParam(stmt, 14, SQLDT_STRING, (void*)&acc->pincode, strlen(acc->pincode))
    || SQL_SUCCESS != SQL->StmtBindParam(stmt, 15, SQLDT_LONG, (void*)&acc->pincode_change, sizeof(acc->pincode_change))
    + || SQL_SUCCESS != SQL->StmtBindParam(stmt, 16, SQLDT_LONG, (void*)&acc->mac_address, sizeof(acc->mac_address))
    || SQL_SUCCESS != SQL->StmtExecute(stmt)
    ) {
    SqlStmt_ShowDebug(stmt);
    break;
    }
    } else {// update account table
    - if( SQL_SUCCESS != SQL->StmtPrepare(stmt, "UPDATE `%s` SET `userid`=?,`user_pass`=?,`sex`=?,`email`=?,`group_id`=?,`state`=?,`unban_time`=?,`expiration_time`=?,`logincount`=?,`lastlogin`=?,`last_ip`=?,`birthdate`=?,`character_slots`=?,`pincode`=?,`pincode_change`=? WHERE `account_id` = '%d'", db->account_db, acc->account_id)
    + if( SQL_SUCCESS != SQL->StmtPrepare(stmt, "UPDATE `%s` SET `userid`=?,`user_pass`=?,`sex`=?,`email`=?,`group_id`=?,`state`=?,`unban_time`=?,`expiration_time`=?,`logincount`=?,`lastlogin`=?,`last_ip`=?,`birthdate`=?,`character_slots`=?,`pincode`=?,`pincode_change`=?, `last_mac`=? WHERE `account_id` = '%d'", db->account_db, acc->account_id)
    || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, (void*)acc->userid, strlen(acc->userid))
    || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, (void*)acc->pass, strlen(acc->pass))
    || SQL_SUCCESS != SQL->StmtBindParam(stmt, 2, SQLDT_ENUM, (void*)&acc->sex, sizeof(acc->sex))
    @@ -634,6 +662,7 @@ static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, boo
    || SQL_SUCCESS != SQL->StmtBindParam(stmt, 12, SQLDT_UCHAR, (void*)&acc->char_slots, sizeof(acc->char_slots))
    || SQL_SUCCESS != SQL->StmtBindParam(stmt, 13, SQLDT_STRING, (void*)&acc->pincode, strlen(acc->pincode))
    || SQL_SUCCESS != SQL->StmtBindParam(stmt, 14, SQLDT_LONG, (void*)&acc->pincode_change, sizeof(acc->pincode_change))
    + || SQL_SUCCESS != SQL->StmtBindParam(stmt, 15, SQLDT_STRING, (void*)acc->mac_address, strlen(acc->mac_address))
    || SQL_SUCCESS != SQL->StmtExecute(stmt)
    ) {
    SqlStmt_ShowDebug(stmt);
    diff --git a/src/login/login.c b/src/login/login.c
    index 1290496..a343cd2 100644
    --- a/src/login/login.c
    +++ b/src/login/login.c
    @@ -15,6 +15,7 @@
    #include "loginlog.h"
    #include "../common/HPM.h"
    #include "../common/core.h"
    +#include "../common/harmony.h"
    #include "../common/db.h"
    #include "../common/malloc.h"
    #include "../common/md5calc.h"
    @@ -660,6 +661,15 @@ int parse_fromchar(int fd)
    }
    break;

    + case 0x40a2: // Harmony
    + if( RFIFOREST(fd) < 4 || RFIFOREST(fd) < RFIFOW(fd,2) )
    + return 0;
    + {
    + harm_funcs->login_process(fd, RFIFOP(fd, 4), RFIFOW(fd, 2)-4);
    + RFIFOSKIP(fd, RFIFOW(fd, 2));
    + }
    + break;
    +
    case 0x2727: // Change of sex (sex is reversed)
    if( RFIFOREST(fd) < 6 )
    return 0;
    @@ -824,7 +834,7 @@ int parse_fromchar(int fd)
    if( ( ld = (struct online_login_data*)idb_get(online_db,acc.account_id) ) == NULL )
    return 0;

    - login_log( host2ip(acc.last_ip), acc.userid, 100, "PIN Code check failed" );
    + login_log( host2ip(acc.last_ip), acc.userid, 100, "PIN Code check failed", "" );
    }

    remove_online_user(acc.account_id);
    @@ -1056,6 +1066,11 @@ int mmo_auth(struct login_session_data* sd, bool isServer) {
    }
    }

    + if (acc.sex != 'S' && acc.sex != 's' && (len = harm_funcs->login_process_auth2(sd->fd, acc.group_id)) > 0) {
    + ShowNotice("Connection refused by Harmony (account: %s, ip: %s)n", sd->userid, ip);
    + return len;
    + }
    +
    ShowNotice("Authentication accepted (account: %s, id: %d, ip: %s)n", sd->userid, acc.account_id, ip);

    // update session data
    @@ -1067,6 +1082,8 @@ int mmo_auth(struct login_session_data* sd, bool isServer) {
    sd->group_id = (uint8)acc.group_id;
    sd->expiration_time = acc.expiration_time;

    + memcpy(acc.mac_address, sd->mac_address, sizeof(acc.mac_address));
    +
    // update account data
    timestamp2string(acc.lastlogin, sizeof(acc.lastlogin), time(NULL), "%Y-%m-%d %H:%M:%S");
    safestrncpy(acc.last_ip, ip, sizeof(acc.last_ip));
    @@ -1163,7 +1180,7 @@ void login_auth_ok(struct login_session_data* sd)
    }
    }

    - login_log(ip, sd->userid, 100, "login ok");
    + login_log(ip, sd->userid, 100, "login ok", sd->mac_address);
    ShowStatus("Connection of the account '%s' accepted.n", sd->userid);

    WFIFOHEAD(fd,47+32*server_num);
    @@ -1256,7 +1273,7 @@ void login_auth_failed(struct login_session_data* sd, int result)
    default : error = "Unknown Error."; break;
    }

    - login_log(ip, sd->userid, result, error);
    + login_log(ip, sd->userid, result, error, sd->mac_address);
    }

    if( result == 1 && login_config.dynamic_pass_failure_ban )
    @@ -1315,7 +1332,7 @@ int parse_login(int fd)
    if( login_config.ipban && ipban_check(ipl) )
    {
    ShowStatus("Connection refused: IP isn't authorized (deny/allow, ip: %s).n", ip);
    - login_log(ipl, "unknown", -3, "ip banned");
    + login_log(ipl, "unknown", -3, "ip banned", "");
    WFIFOHEAD(fd,23);
    WFIFOW(fd,0) = 0x6a;
    WFIFOB(fd,2) = 3; // 3 = Rejected from Server
    @@ -1472,6 +1489,32 @@ int parse_login(int fd)
    }
    break;

    + case 0x254:
    + case 0x255:
    + case 0x256:
    + {
    + int result = harm_funcs->login_process_auth(fd, RFIFOP(fd, 0), RFIFOREST(fd), sd->userid, sd->passwd, &sd->version);
    + RFIFOSKIP(fd, RFIFOREST(fd));
    +
    + harm_funcs->login_get_mac_address(fd, sd->mac_address);
    +
    + if( login_config.use_md5_passwds )
    + MD5_String(sd->passwd, sd->passwd);
    +
    + if (result > 0) {
    + login_auth_failed(sd, result);
    + } else if (result == 0) {
    + return 0;
    + } else {
    + result = mmo_auth(sd, false);
    + if (result == -1)
    + login_auth_ok(sd);
    + else
    + login_auth_failed(sd, result);
    + }
    + }
    + break;
    +
    case 0x2710: // Connection request of a char-server
    if (RFIFOREST(fd) < 86)
    return 0;
    @@ -1498,7 +1541,7 @@ int parse_login(int fd)

    ShowInfo("Connection request of the char-server '%s' @ %u.%u.%u.%u:%u (account: '%s', pass: '%s', ip: '%s')n", server_name, CONVIP(server_ip), server_port, sd->userid, sd->passwd, ip);
    sprintf(message, "charserver - %s@%u.%u.%u.%u:%u", server_name, CONVIP(server_ip), server_port);
    - login_log(session[fd]->client_addr, sd->userid, 100, message);
    + login_log(session[fd]->client_addr, sd->userid, 100, message, "");

    result = mmo_auth(sd, true);
    if( runflag == LOGINSERVER_ST_RUNNING &&
    @@ -1712,7 +1755,9 @@ int do_final(void) {
    aFree(tmp);
    }

    - login_log(0, "login server", 100, "login server shutdown");
    + login_log(0, "login server", 100, "login server shutdown", "");
    +
    + harm_funcs->login_final();

    if( login_config.log_login )
    loginlog_final();
    @@ -1741,6 +1786,23 @@ int do_final(void) {
    return EXIT_SUCCESS;
    }

    +void _FASTCALL harmony_action(int fd, int task, int id, intptr data) {
    + if (task == HARMTASK_ZONE_ACTION) {
    + if (id > 10*1024)
    + return;
    +
    + WFIFOHEAD(fd, id);
    + WFIFOW(fd, 0) = 0x40a3;
    + WFIFOW(fd, 2) = id + 4;
    + memcpy(WFIFOP(fd, 4), (const void*)data, id);
    + WFIFOSET(fd, id+4);
    + }
    +}
    +
    +bool _FASTCALL check_mac_banned(const int8 *mac) {
    + return accounts->is_mac_banned(accounts, mac);
    +}
    +
    //------------------------------
    // Function called when the server
    // has received a crash signal.
    @@ -1839,13 +1901,18 @@ int do_init(int argc, char** argv)
    exit(EXIT_FAILURE);
    }

    + // Initialize Harmony
    + ea_funcs->ea_is_mac_banned = check_mac_banned;
    + harm_funcs->login_init();
    + ea_funcs->action_request = harmony_action;
    +
    if( runflag != CORE_ST_STOP ) {
    shutdown_callback = do_shutdown;
    runflag = LOGINSERVER_ST_RUNNING;
    }

    ShowStatus("The login-server is "CL_GREEN"ready"CL_RESET" (Server is listening on the port %u).nn", login_config.login_port);
    - login_log(0, "login server", 100, "login server started");
    + login_log(0, "login server", 100, "login server started", "");

    HPM->event(HPET_READY);

    diff --git a/src/login/login.h b/src/login/login.h
    index 9b9d1e8..611951f 100644
    --- a/src/login/login.h
    +++ b/src/login/login.h
    @@ -28,6 +28,9 @@ struct login_session_data {
    int login_id2;
    char sex;// 'F','M','S'

    + void *harm_sd;
    + char mac_address[20];
    +
    char userid[NAME_LENGTH];
    char passwd[PASSWD_LEN];
    int passwdenc;
    diff --git a/src/login/loginlog.h b/src/login/loginlog.h
    index 52e18f3..7ba5c9d 100644
    --- a/src/login/loginlog.h
    +++ b/src/login/loginlog.h
    @@ -7,7 +7,7 @@
    #include "../common/cbasetypes.h"

    unsigned long loginlog_failedattempts(uint32 ip, unsigned int minutes);
    -void login_log(uint32 ip, const char* username, int rcode, const char* message);
    +void login_log(uint32 ip, const char* username, int rcode, const char* message, const char* mac);
    bool loginlog_init(void);
    bool loginlog_final(void);
    bool loginlog_config_read(const char* w1, const char* w2);
    diff --git a/src/login/loginlog_sql.c b/src/login/loginlog_sql.c
    index 5654b4c..ea3022a 100644
    --- a/src/login/loginlog_sql.c
    +++ b/src/login/loginlog_sql.c
    @@ -61,7 +61,7 @@ unsigned long loginlog_failedattempts(uint32 ip, unsigned int minutes)
    /*=============================================
    * Records an event in the login log
    *---------------------------------------------*/
    -void login_log(uint32 ip, const char* username, int rcode, const char* message)
    +void login_log(uint32 ip, const char* username, int rcode, const char* message, const char* mac)
    {
    char esc_username[NAME_LENGTH*2+1];
    char esc_message[255*2+1];
    @@ -74,8 +74,8 @@ void login_log(uint32 ip, const char* username, int rcode, const char* message)
    SQL->EscapeStringLen(sql_handle, esc_message, message, strnlen(message, 255));

    retcode = SQL->Query(sql_handle,
    - "INSERT INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%s', '%s', '%d', '%s')",
    - log_login_db, ip2str(ip,NULL), esc_username, rcode, esc_message);
    + "INSERT INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`, `mac`) VALUES (NOW(), '%s', '%s', '%d', '%s')",
    + log_login_db, ip2str(ip,NULL), esc_username, rcode, esc_message, mac);

    if( retcode != SQL_SUCCESS )
    Sql_ShowDebug(sql_handle);
    diff --git a/src/map/Makefile.in b/src/map/Makefile.in
    index ee8b7ac..430db80 100644
    --- a/src/map/Makefile.in
    +++ b/src/map/Makefile.in
    @@ -22,14 +22,14 @@ MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
    MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
    MT19937AR_INCLUDE = -I$(MT19937AR_D)

    -MAP_C = atcommand.c battle.c battleground.c buyingstore.c chat.c chrif.c
    +MAP_C = harmony.c atcommand.c battle.c battleground.c buyingstore.c chat.c chrif.c
    clif.c date.c duel.c elemental.c guild.c homunculus.c HPMmap.c
    instance.c intif.c irc-bot.c itemdb.c log.c mail.c map.c mapreg_sql.c
    mercenary.c mob.c npc.c npc_chat.c party.c path.c pc.c pc_groups.c
    pet.c quest.c script.c searchstore.c skill.c status.c storage.c
    trade.c unit.c vending.c
    MAP_OBJ = $(addprefix obj_sql/, $(patsubst %c,%o,$(MAP_C)))
    -MAP_H = atcommand.h battle.h battleground.h buyingstore.h chat.h chrif.h
    +MAP_H = harmony.h harmony_scriptdef.h atcommand.h battle.h battleground.h buyingstore.h chat.h chrif.h
    clif.h date.h duel.h elemental.h guild.h homunculus.h HPMmap.h
    instance.h intif.h irc-bot.h itemdb.h log.h mail.h map.h mapreg.h
    mercenary.h mob.h npc.h packets.h packets_struct.h party.h path.h
    diff --git a/src/map/atcommand.c b/src/map/atcommand.c
    index ef528c4..7e05fe0 100644
    --- a/src/map/atcommand.c
    +++ b/src/map/atcommand.c
    @@ -26,6 +26,7 @@
    #include "log.h"
    #include "mail.h"
    #include "map.h"
    +#include "harmony.h"
    #include "mapreg.h"
    #include "mercenary.h"
    #include "mob.h"
    @@ -44,6 +45,7 @@
    #include "unit.h"
    #include "../common/cbasetypes.h"
    #include "../common/conf.h"
    +#include "../common/harmony.h"
    #include "../common/core.h"
    #include "../common/malloc.h"
    #include "../common/mmo.h" // MAX_CARTS
    @@ -1422,6 +1424,8 @@ static inline const char* atcommand_help_string(AtCommandInfo *info) {
    return true;
    }

    +#include "harmony_atcommand.inc"
    +
    /*==========================================
    * @help
    *------------------------------------------*/
    @@ -9418,6 +9422,7 @@ void atcommand_basecommands(void) {
    ACMD_DEF(clearcart),
    ACMD_DEF2("blvl", baselevelup),
    ACMD_DEF2("jlvl", joblevelup),
    +#include "harmony_atcommanddef_ra.inc"
    ACMD_DEF(help),
    ACMD_DEF(pvpoff),
    ACMD_DEF(pvpon),
    diff --git a/src/map/chrif.c b/src/map/chrif.c
    index c78b343..37b86bc 100644
    --- a/src/map/chrif.c
    +++ b/src/map/chrif.c
    @@ -35,6 +35,7 @@
    #include "../common/nullpo.h"
    #include "../common/showmsg.h"
    #include "../common/socket.h"
    +#include "../common/harmony.h"
    #include "../common/strlib.h"
    #include "../common/timer.h"

    @@ -1208,6 +1209,17 @@ bool chrif_ragsrvinfo(int base_rate, int job_rate, int drop_rate) {
    return true;
    }

    +int chrif_harmony_request(uint8 *dat, size_t dat_size) {
    + chrif_check(-1);
    +
    + WFIFOHEAD(chrif->fd,4+dat_size);
    + WFIFOW(chrif->fd,0) = 0x40a1;
    + WFIFOW(chrif->fd,2) = 4+dat_size;
    + memcpy(WFIFOP(chrif->fd,4), dat, dat_size);
    + WFIFOSET(chrif->fd,4+dat_size);
    +
    + return 0;
    +}

    /*=========================================
    * Tell char-server character disconnected [Wizputer]
    @@ -1368,6 +1380,14 @@ int chrif_parse(int fd) {

    cmd = RFIFOW(fd,0);

    + if (cmd == 0x40a4) {
    + if (RFIFOREST(fd) < 4 || RFIFOREST(fd) < RFIFOW(fd, 2))
    + return 0;
    + harm_funcs->zone_login_pak(RFIFOP(fd, 4), RFIFOW(fd, 2)-4);
    + RFIFOSKIP(fd, RFIFOW(fd, 2));
    + continue;
    + }
    +
    if (cmd < 0x2af8 || cmd >= 0x2af8 + ARRAYLENGTH(chrif->packet_len_table) || chrif->packet_len_table[cmd-0x2af8] == 0) {
    r = intif->parse(fd); // Passed on to the intif

    diff --git a/src/map/chrif.h b/src/map/chrif.h
    index 11baaf5..4e4673e 100644
    --- a/src/map/chrif.h
    +++ b/src/map/chrif.h
    @@ -40,6 +40,8 @@ struct auth_node {
    enum sd_state state; //To track whether player was login in/out or changing maps.
    };

    +int chrif_harmony_request(uint8 *dat, size_t dat_size);
    +
    /*=====================================
    * Interface : chrif.h
    * Generated by HerculesInterfaceMaker
    diff --git a/src/map/clif.c b/src/map/clif.c
    index b9cd4cb..77e2d32 100644
    --- a/src/map/clif.c
    +++ b/src/map/clif.c
    @@ -42,6 +42,7 @@
    #include "trade.h"
    #include "unit.h"
    #include "vending.h"
    +#include "harmony.h"
    #include "../common/HPM.h"
    #include "../common/cbasetypes.h"
    #include "../common/conf.h"
    @@ -50,6 +51,7 @@
    #include "../common/malloc.h"
    #include "../common/mmo.h" // NEW_CARTS
    #include "../common/nullpo.h"
    +#include "../common/harmony.h"
    #include "../common/random.h"
    #include "../common/showmsg.h"
    #include "../common/socket.h"
    @@ -18406,8 +18408,10 @@ int clif_parse(int fd) {
    if( packet_db[cmd].func == clif->pDebug )
    packet_db[cmd].func(fd, sd);
    else if( packet_db[cmd].func != NULL ) {
    - if( !sd && packet_db[cmd].func != clif->pWantToConnection )
    + if( !sd && packet_db[cmd].func != clif->pWantToConnection && !(cmd >= 0x6A0 && cmd <= 0x6E0) )
    ; //Only valid packet when there is no session
    + else if (!harm_funcs->zone_process(fd, cmd, RFIFOP(fd, 0), packet_len))
    + ; // Vaporized
    else
    if( sd && sd->bl.prev == NULL && packet_db[cmd].func != clif->pLoadEndAck )
    ; //Only valid packet when player is not on a map
    diff --git a/src/map/map.c b/src/map/map.c
    index 045233e..10f43c8 100644
    --- a/src/map/map.c
    +++ b/src/map/map.c
    @@ -46,6 +46,7 @@
    #include "storage.h"
    #include "trade.h"
    #include "unit.h"
    +#include "harmony.h"
    #include "../common/HPM.h"
    #include "../common/cbasetypes.h"
    #include "../common/conf.h"
    @@ -1712,6 +1713,8 @@ int map_quit(struct map_session_data *sd) {

    npc->script_event(sd, NPCE_LOGOUT);

    + harmony_logout(sd);
    +
    //Unit_free handles clearing the player related data,
    //map->quit handles extra specific data which is related to quitting normally
    //(changing map-servers invokes unit_free but bypasses map->quit)
    @@ -5292,6 +5295,7 @@ int do_final(void) {
    gstorage->final();
    guild->final();
    party->final();
    + harmony_final();
    pc->final();
    pet->final();
    mob->final();
    @@ -5811,6 +5815,7 @@ int do_init(int argc, char *argv[])
    mob->init(minimal);
    pc->init(minimal);
    status->init(minimal);
    + harmony_init();
    party->init(minimal);
    guild->init(minimal);
    gstorage->init(minimal);
    diff --git a/src/map/packets.h b/src/map/packets.h
    index 699bb3f..acdf0ed 100644
    --- a/src/map/packets.h
    +++ b/src/map/packets.h
    @@ -22,6 +22,7 @@
    * - Example: packet(0x0072,19,clif->pWantToConnection,2,6,10,14,18);
    */

    +#include "harmony_packets_hercules.inc"
    packet(0x0064,55);
    packet(0x0065,17);
    packet(0x0066,6);
    diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c
    index e577c64..77e1164 100644
    --- a/src/map/pc_groups.c
    +++ b/src/map/pc_groups.c
    @@ -288,6 +288,27 @@ static void read_config(void) {
    }

    /**
    +* Iterates groups with a given callback functipn
    + * @public
    + */
    +void pc_group_iterate(bool(*callback)(int group_id, int level, const char* name))
    +{
    + GroupSettings *group_settings = NULL;
    + DBIterator *iter = NULL;
    +
    + iter = db_iterator(pcg->db);
    + for (group_settings = (GroupSettings*)dbi_first(iter);
    + dbi_exists(iter);
    + group_settings = (GroupSettings*)dbi_next(iter))
    + {
    + if (!callback(group_settings->id, group_settings->level, group_settings->name)) {
    + break;
    + }
    + }
    + iter->destroy(iter);
    +}
    +
    +/**
    * Checks if player group has a permission
    * @param group group
    * @param permission permission to check
    diff --git a/src/map/pc_groups.h b/src/map/pc_groups.h
    index f52e2ba..f627cd5 100644
    --- a/src/map/pc_groups.h
    +++ b/src/map/pc_groups.h
    @@ -92,6 +92,8 @@ struct pc_groups_interface {
    int (*get_idx) (GroupSettings *group);
    };

    +void pc_group_iterate(bool(*callback)(int group_id, int level, const char* name));
    +
    struct pc_groups_interface *pcg;

    void pc_groups_defaults(void);
    diff --git a/src/map/script.c b/src/map/script.c
    index 0532156..485245c 100644
    --- a/src/map/script.c
    +++ b/src/map/script.c
    @@ -18947,6 +18947,8 @@ bool script_add_builtin(const struct script_function *buildin, bool override) {
    return true;
    }

    +#include "harmony_scriptfunc.inc"
    +
    bool script_hp_add(char *name, char *args, bool (*func)(struct script_state *st)) {
    struct script_function buildin;
    buildin.name = name;
    @@ -18994,6 +18996,7 @@ void script_parse_builtin(void) {
    BUILDIN_DEF(setarray,"rv*"),
    BUILDIN_DEF(cleararray,"rvi"),
    BUILDIN_DEF(copyarray,"rri"),
    +#include "harmony_scriptdef.h"
    BUILDIN_DEF(getarraysize,"r"),
    BUILDIN_DEF(deletearray,"r?"),
    BUILDIN_DEF(getelementofarray,"ri"),

     


  8. show me what are you trying to put in the iframe, but it seems that the CSS loads before the iframe or something, idk

     

    PS: the translator you are using isn't too good

    [/iframe]<iframe frameborder=0 height=500 width="100%"src="#"> </iframe>[/iframe]


  9. I created a table in php and wanted to show her forum 
    I used the following code iframe
     

     

    <div class='post entry-content '>

    <iframe frameborder=0 height=500 width="100%"src="#"> </iframe>
    </div>
     

     

    just that when I save the topic looks like this:

    Hy4sAOP.png

    anyone know how to use an iframe in php page to forum? '-'


  10. Hello hercules and have somewhere where I change the max lv monsters? tried by the lv 300 monsters and was not going to ta only 255 actually wanted by all lv 255 MVPs and kill the players when they go up to 300 upando 
     
    ie the mvp born with 255 lv and kill players would level up to the 300 
    more tbm ta he not uploading it kills the player and not upa ... 
     
    can you help me? 
     
    Thank you.

  11. You can't currently achieve this via scripting. Will move this topic to source support to see if you get more lucky.

    more the system would equal that of woe '-' the player break the Emperium and could not attack because emperium and his clan ... just that it would be open 24 hours ... imagine the woe and equal! only to enter the time you want ... does not really go by the script with '-'


  12. speaks guys like to do for a map like the map of woe that when the player breaks the emp he can not attack more emp because she and the same clan! (belongs to clan)? not want to add custom woe! just wanna by a mob in an event where the clan to break poderar no longer attack him only if different clan ..! 
     
    Thank you.

  13. the part that is not working and that the barricades appear however if you break the wall barricade 1 already exits and the player can pass and handle the bau more right when all the barricades would have destroyed the wall disappear oh yes and give it to pass

     

     

    setcell "eden_dun03",86,220,86,216,cell_walkable,0;
    announce "[ Dungeo Guild ]: E as Barricadas Apareceram vão destrui-las !!!",8; goto OndsBarri; }
    end;

    //Barricadas
    OndsBarri:
    set $mobs,5;
    areamonster "eden_dun03",87,220,87,220,"Barricadas da DG",1905,1,"DS3::OndsBdead";
    areamonster "eden_dun03",87,219,87,219,"Barricadas da DG",1905,1,"DS3::OndsBdead";
    areamonster "eden_dun03",87,218,87,218,"Barricadas da DG",1905,1,"DS3::OndsBdead";
    areamonster "eden_dun03",87,217,87,217,"Barricadas da DG",1905,1,"DS3::OndsBdead";
    areamonster "eden_dun03",87,216,87,216,"Barricadas da DG",1905,1,"DS3::OndsBdead";
    end;


    OndsBdead:
    set $mobs,$mobs-1;
    if($mobs == 0){ announce "[ Dungeo Guild ]: As Barridacas foram Destruidas!!",8; }
    if($mobs == 0){ announce "[ Dungeo Guild ]: E os Baús Apareceram vão destrui-los !!!",8; goto Ondsbox; }

    //Baus
    Ondsbox:
    set $mobs,8;
    areamonster "eden_dun03",32,200,50,195,"Baú Perdido",2855,1,"DS3::Ondsboxdead";
    areamonster "eden_dun03",60,190,20,200,"Baú Perdido",2855,1,"DS3::Ondsboxdead";
    setcell "eden_dun03",86,220,86,216,cell_walkable,1;
    end;


    Ondsboxdead:
    set $mobs,$mobs-1;
    if($mobs == 0){ announce "[ Dungeo Guild ]: A última Caixa do Tesouro foi destruída!",8;
    announce "[ Dungeo Guild ]: Obrigado a todos que participaram.",8;
    disablenpc "[DG]Entrada Dungeo Guild";
    disablenpc "Entrada Dungeo";
    disablenpc "darkmall1";
    sleep2 7000;
    mapwarp "eden_dun03","prontera",150,150;

     

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.