Jump to content

Denis

Banned
  • Posts

    1031
  • Joined

  • Last visited

  • Days Won

    53
  • Feedback

    0%

Community Answers

  1. Denis's post in [C++] Error with 2 functions was marked as the answer   
    int guild_get_gold(lua_State* L) { LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); if(ch && ch->GetGuild()) { CGuild * pkGuild = CGuildManager::instance().FindGuild(ch->GetGuild()->GetID()); if(pkGuild) lua_pushnumber(L, pkGuild ? pkGuild->GetGuildMoney() : 0); } return 1; } int guild_change_money(lua_State * L) { int gold = (int)lua_tonumber(L, 1); LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr(); if(ch && ch->GetGuild()) { CGuild * pkGuild = CGuildManager::instance().FindGuild(ch->GetGuild()->GetID()); if(pkGuild && gold > 0) pkGuild->RecvMoneyChange(gold); } return 1; } With these you don't need to pass any arguments so just call them like that:
    when 20091.click with pc.has_guild() begin local s = select("Get guild gold","Change guild gold","Exit") if s == 1 then say(string.format("Your guild gold: %s",guild.get_gold())) end else if s == 2 then say("Enter your amount") local gold = input("") if type(gold) == "number" then guild.change_gold(gold) say_reward(string.format("Your new guild gold ammount is: %s",guild.get_gold())) else say_reward("Only numbers are allowed") end end end I didn't really test these functions but I guess they should work.
  2. Denis's post in Server src, do an exec with one command ? all player do /dance5 for example.. was marked as the answer   
    struct DanceCommand {     DanceCommand() :     {     }     void operator () (LPENTITY ent)     {         if (!ent->IsType(ENTITY_CHARACTER))             return;         LPCHARACTER pkChr = (LPCHARACTER) ent;                  const char* command = "dance 5"; // if it won't work try to replace dance 5 with /dance 5         size_t len = strlen(command);         interpret_command(pkChr, command, len);     } }; ACMD(do_new_command) {     char arg1[256];     one_argument(argument, arg1, sizeof(arg1));     DanceCommand func(ch);     LPSECTREE sectree = ch->GetSectree();     if (sectree)     {         sectree->ForEachAround(func);     }     else     {         sys_err("PURGE_ERROR.NULL_SECTREE(mapIndex=%d, pos=(%d, %d)", ch->GetMapIndex(), ch->GetX(), ch->GetY());     } }
  3. Denis's post in [NeedtobeEdited]Soul Stone for Wolfman was marked as the answer   
    Just add the skill vnums to GM_SKILL_NAME_DICT table from locale.lua and add to special.active_skill_list(questlib.lua) a new array with the wolfman skills.
  4. Denis's post in bug with new binary / game (mainline_released) was marked as the answer   
    If you changed short -> int at tables.h you must recompile db too.
  5. Denis's post in Problem with global chat was marked as the answer   
    You just didn't write properly the color codes,anyway here they are:
    |cFF0080FF|H|h[Jinno]|cFFA7FFD4|H|h |cFFFFFF00|H|h[Chunjo]|cFFA7FFD4|H|h |cFFff0000|H|h[Shinsoo]|cFFA7FFD4|H|h At Chungo you had a C instead of c and at Shinsoo you had 3 zeros instead of 4
  6. Denis's post in Quest Error was marked as the answer   
    quest mapapvp begin     state start begin         when login with pc.get_map_index() == 70 begin             say("Welcome to PVP Map")             say("You need to kill 3 players.")             say("When you kill 3 players you get the reward.")             pc.setqf("conta_kills",1)         end         when kill with npc.is_pc() and pc.get_map_index() == 70 begin             if pc.getqf("conta_kills") == 3 then                 pc.change_money(250000)                 warp_to_village()             else                 pc.setqf("conta_kills", pc.getqf("conta_kills")+1)             end         end             end end There's no point to create a new quest state..
  7. Denis's post in Skills + Delete character was marked as the answer   
    2)
  8. Denis's post in compiling game on freebsd was marked as the answer   
    Compile libpoly
  9. Denis's post in problem mainline was marked as the answer   
    Open ClientManagerPlayer.cpp from your db source and find this piece of code:
            snprintf(queryStr, sizeof(queryStr), "INSERT INTO player%s_deleted SELECT * FROM player%s WHERE id=%d",                 GetTablePostfix(), GetTablePostfix(), pi->player_id);         std::auto_ptr<SQLMsg> pIns(CDBManager::instance().DirectQuery(queryStr));         if (pIns->Get()->uiAffectedRows == 0 || pIns->Get()->uiAffectedRows == (uint32_t)-1)         {             sys_log(0, "PLAYER_DELETE FAILED %u CANNOT INSERT TO player%s_deleted", dwPID, GetTablePostfix());             peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, pi->dwHandle, 1);             peer->EncodeBYTE(pi->account_index);             return;         } and replace it to this(If you want to improve it you could make the deleted character data go to player_deleted,because I removed it here):
            snprintf(queryStr, sizeof(queryStr), "SELECT * FROM player%s WHERE id=%d",                 GetTablePostfix(), pi->player_id);         std::auto_ptr<SQLMsg> pIns(CDBManager::instance().DirectQuery(queryStr));         if (pIns->Get()->uiNumRows == 0)         {             sys_log(0, "PLAYER_DELETE FAILED %u CANNOT INSERT TO player%s_deleted", dwPID, GetTablePostfix());             peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, pi->dwHandle, 1);             peer->EncodeBYTE(pi->account_index);             return;         } The character delete was actually bugged in the mainline (I don't know for the other branches).
     
  10. Denis's post in Yang value separated by "." in trade was marked as the answer   
    Open localeinfo.py and find this:
    def NumberToMoneyString(n) : if n <= 0 : return "0 %s" % (MONETARY_UNIT0) return "%s %s" % ('.'.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ]), MONETARY_UNIT0) and replace it to this:
    def NumberToMoneyString(n,y=0) : if n <= 0 : if y == 0: return "0 %s" % (MONETARY_UNIT0) else: return "0" if y == 0: return "%s %s" % ('.'.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ]), MONETARY_UNIT0) else: return "%s" % ('.'.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ])) self.OwnerMoney.SetText(localeInfo.NumberToMoneyString(exchange.GetElkFromSelf(),1)) self.TargetMoney.SetText(localeInfo.NumberToMoneyString(exchange.GetElkFromTarget(),1))
  11. Denis's post in New applytype,applyvalue was marked as the answer   
    Find applytype occurrences and there applytype3.
  12. Denis's post in Start a quest from python was marked as the answer   
    http://metin2dev.org/board/topic/1698-howtooldquest-client-communicationfor-any-version/
     
    Next time search before posting
  13. Denis's post in Which It The Best Source ? was marked as the answer   
    The best combination is mainline server and novaline client
  14. Denis's post in How to extract metin2_patch_pc3 was marked as the answer   
    http://metin2dev.org/board/topic/2482-howto-unpack-official-patches/ Here is how you can extract patches
  15. Denis's post in Remove italic orange text from gm's was marked as the answer   
    Open input_main.cpp and remove this:
    if (ch->IsGM()) bType = (bType & 0xF0) | WHISPER_TYPE_GM;
  16. Denis's post in Bug invisibility as login was marked as the answer   
    At char_affect.cpp find this:
    if (AFFECT_REVIVE_INVISIBLE != pkAff->dwType) { ComputePoints(); } and make it look like this:
    if (AFFECT_REVIVE_INVISIBLE != pkAff->dwType) { ComputePoints(); } else { UpdatePacket(); }
  17. Denis's post in Drop table was marked as the answer   
    Here is one quest with table:
    quest hdf begin state start begin function ab() local ju = { --mob-id--min-level--max-level---item-count---percentage---item-id's----percentage change per level {101, 1, 10, 3, 50,30,20, 19, 20, 21, 1}, } return ju end when kill with not npc.is_pc() begin local boni,lck,per,luck,bsp = 0,0,0,0,hdf.ab() for i = 1, table.getn(bsp)+1, 1 do if npc.get_race() == bsp[i][1] then if pc.get_level() >= bsp[i][2] and pc.get_level() <= bsp[i][3] then boni = (bsp[i][2] - pc.get_level()) * (-1) boni = boni * bsp[i][bsp[i][4]*2+5] luck = number(1,bsp[i][4]) luck = luck + 4 + bsp[i][4] lck = luck - bsp[i][4] per = 100 - bsp[i][lck] + boni lck = number(1,100) if lck > per then pc.give_item2(bsp[i][luck], 1) end end end end end end end
  18. Denis's post in How to fix client binnary was marked as the answer   
    Compile the bin in release/distribute mode
  19. Denis's post in How to Alignment Change was marked as the answer   
    In the file char_battle.cpp find this:

    In the source the alignment is *10 (for example 20000*10 = 200000) so you need to change 200000 to whatever you want
  20. Denis's post in How can i make that? was marked as the answer   
    self.AppendTextLine("blablabla") in def __SetItemTitle(self, itemVnum, metinSlot, attrSlot) at the file uitooltip.py
  21. Denis's post in [ANSWER]Creating dynamic libraries for LUA quests was marked as the answer   
    I hope this will help you http://heavycoder.com/tutorials/lua_extend.php
  22. Denis's post in game + db mainline erro was marked as the answer   
    You should use freebsd version >= 9.2
  23. Denis's post in Disable attr change time was marked as the answer   
    find this string:
    if (GM_PLAYER == GetGMLevel() && false == test_server) { ... } and comment or delete it
  24. Denis's post in What source version should I use? was marked as the answer   
    the novaline branch is touched by third persons,the mainline is untouched.I suggest you to use mainline game binary and novaline client binary(I told you novaline because you won't have any packets error with that branch,if you use another you'll have errors)
  25. Denis's post in [C++]/war BUG was marked as the answer   
    navigate to game/src/cmd_general.cpp
     
    find this:
    if (type >= GUILD_WAR_TYPE_MAX_NUM) and replace it with this:
    if (type >= GUILD_WAR_TYPE_MAX_NUM || type < 0) So when the type is negative the type automatically would be set to the default value
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / 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.