Jump to content

newja

Inactive Member
  • Posts

    52
  • Joined

  • Last visited

  • Days Won

    2
  • Feedback

    0%

Posts posted by newja

  1. sema / newja, did your quest are release or not ? Or how to put the pet level before his name please ?

    What do you mean by saying

     

    your quest are released

     

    which one?  :huh:

    ##############################

    To see pet level you must go to PetSystem.cpp

    find

    void CPetActor::SetName(const char* name)

    and replace whole function with this

    void CPetActor::SetName(const char* name)
    {
        std::string petName = "";
     
        if (0 != m_pkOwner && 
            0 == name && 
            0 != m_pkOwner->GetName())
        {
            petName += "";
        }
        else
            petName += name;
     
        if (true == IsSummoned())
            m_pkChar->SetName(petName);
     
        m_name = petName;
    }

    If you want to know how to set pet name, look into this

    quest pet begin
    state start begin
        when seal_id.use begin
            level = 99 -- here, you can insert a variable or anything you want
            vnum = 53008 -- pet ID
            name = "Petty-chan" -- pet Name
            pet.summon(vnum, "[Lv."..level.."] - "..name, false)
        end
    end
    end

    Regards,

    newja

    • Love 1
  2.             if (CBattleArena::instance().IsBattleArenaMap(pkAttacker->GetMapIndex()) == false)
                {
                    if (pkAttacker->IsPC())
                    {
                        item->SetOwnership(pkAttacker);
                    }
                    else if (pkAttacker->IsPet())
                    {
                        for (CPetSystem::TPetActorMap::iterator go = pkAttacker->GetPetSystem()->m_petActorMap.begin();go != pkAttacker->GetPetSystem()->m_petActorMap.end(); ++go)
                        {
                            CPetActor* petActor = go->second;
                            if (NULL != petActor)
                            {
                                LPCHARACTER own = petActor->GetOwner();
                                if (own)
                                {
                                    item->SetOwnership(own);
                                }
                            }
                        }
                    }
                }

    I'm not using pet attack system so I can't test it.

    I'm 50% sure it works.

     

    Include must be added:

     

    #include "PetSystem.h"

    Regards,

    newja

     

     

     

    #Edit

     

    M5UBlCl.png

     

    BSzKIB1.png

     

    dtL4U25.gif

     

    Works.

    • Love 4
  3.     int npc_get_hp_by_vid(lua_State* L)
        {
            lua_Number vid = lua_tonumber(L, 1);
            LPCHARACTER npc = CHARACTER_MANAGER::instance().Find(vid);
            if(npc)
            {
                lua_pushnumber(L, npc->GetHP());
            }
            else
            {
                lua_pushnumber(L, 0);
            }
            return 1;
        }
     
        int npc_get_max_hp_by_vid(lua_State* L)
        {
            lua_Number vid = lua_tonumber(L, 1);
            LPCHARACTER npc = CHARACTER_MANAGER::instance().Find(vid);
            if(npc)
            {
                lua_pushnumber(L, npc->GetMaxHP());
            }
            else
            {
                lua_pushnumber(L, 0);
            }
            return 1;
        }
    

    MbmhhGO.gif

     

    + Quest

     

    R6X3I9H.png

     

    Regards,

    newja

    • Metin2 Dev 1
    • Love 1
  4. It's all good, I don't know, upload your whole file in pastebin, i'll correct for you.

    http://pastebin.com/hCCQE23C
    

    You've lost your bracket here

     

                if (m_pkChar->Attack(pkVictim))
                {
                    m_pkChar->SendMovePacket(FUNC_ATTACK, 0, rkPetPos.x, rkPetPos.y, 0, get_dword_time());
                    m_pkChar->SetLastAttacked(get_dword_time());
  5. Yay, managed to fix it, though I made some new functions based on the original ones but it doesn't matter now.

    If you want to fix lag issues you must go to char_affect.cpp and find this:

    bool CHARACTER::RemoveAffect(CAffect * pkAff)

    Not gonna post a complete fix so have fun with it! :D

    The rest of the functions that are linked to that one (and would be nice to do something with them):

    void CHARACTER::ComputeAffect(CAffect * pkAff, bool bAdd)
    bool CHARACTER::RemoveAffect(DWORD dwType)
    void CHARACTER::RemoveGoodAffect()

    Proof here:

    suraskill.gif

     

    or link_to_optimized_version

    dem ymir coders, everything so complicated :wub: 

     

    Regards,

    newja

  6. Go to the pack you have the .GR2 model for the armor and look for this

    sura_pwahuang1_lod_03.gr2
    

    IF you try to open it with granny you will see is blank now delete it and instaid of it make a copy of

    sura_pwahuang1_lod_02.gr2
    

    and rename it to 

    sura_pwahuang1_lod_03.gr2
    

    pack it again and done

    Why would you need both same lods?

    Isn't it better to delete 03 and leave the rest as it is?

  7. @lolor2

    Actually I don't know C++ as much as you do, but let's try again with your help.

    switch(ch->GetGMLevel())
    {
        case GM_IMPLEMENTOR:
        {
            strlcpy(buf, LC_TEXT("Implementor"), sizeof(buf));
            break;
        }
        case GM_HIGH_WIZARD:
        {
            strlcpy(buf, LC_TEXT("High_Wizard"), sizeof(buf));
            break;
        }
        case GM_LOW_WIZARD:
        {
            strlcpy(buf, LC_TEXT("Low_Wizard"), sizeof(buf));
            break;
        }
        case GM_GOD:
        {
            strlcpy(buf, LC_TEXT("God"), sizeof(buf));
            break;
        }
     
        std::string staff_color = "|cFFFF5C5C|H|h[";
        staff_color += buf;
        staff_color += "]|cFFA7FFD4|H|h";
        sprintf(chatbuf_global, "%s %s", staff_color.c_str(), chatbuf);
    }

    Could it work? Atleast I hope so.

     

    // @galet

    srsly wtf man, I don't have to be C++ master to know that your code won't work.  :lol:

  8. Try that

    void LoadExpTable(char* name)
    {
        std::ifstream f(name);
     
        printf("EXP_TABLE load: %s n", name);
        if (!f.is_open())
        {
            printf("EXP_TABLE load: FILE %s OPEN ERROR", name);
            return;
        }
     
        int level = 0;
        long long int exp = 0;
        int line = 0;
     
        while (!f.eof())
        {
            f>>level;
            f>>exp;
            line++;
             
            if (level <= 0 || exp <= 0)
                printf("EXP_TABLE load !ERROR!: LINE %d LEVEL %d EXP %lld n", line, level, exp);
            else if (level > PLAYER_EXP_TABLE_MAX)
                printf("EXP_TABLE load !ERROR!: LINE %d LEVEL %d > MAX EXP LEVEL %dn", line, level, PLAYER_EXP_TABLE_MAX);
            else
            {
                printf("EXP_TABLE load: LINE %d LEVEL %d EXP %lld n", line, level, exp);
                exp_table_common[level] = exp;
            }
        }
     
        printf("EXP_TABLE load: done n");
    }

     

    There shouldn't be any problems unless your EXP table exceed this number 9223372036854775807 which I think won't happen.  :blink:

    //Forgot to mention.. When you get bigger numbers in your EXP table than 4294967295, this line will start to make errors:

    exp_table_common[level] = exp;

    so be cautious.

  9.  

    @Cataclismo:

    Error in putty:

     
    EXP_TABLE load: LINE 100 LEVEL 100 EXP -2144967296
    EXP_TABLE load: LINE 101 LEVEL 101 EXP -2084967296

     

    It's not an error, it's more like display problem (in game everything should work).

    When your DWORD has same size as int (clearly has) you can go to config.cpp and change

    DWORD exp = 0;

    to

    long int exp =0;

    if you need bigger size you can use long long int but then you'll have to replace every %ld with %lld

  10.  

     

    I discovered that problem is in every quest and isnt in Mijago system. Any ideas?

    If you're using 34k game you can apply this diff:

    0017F637: 89 90
    0017F638: 5C 90
    0017F639: 24 90
    0017F63A: 04 90
    0017F63B: 89 90
    0017F63C: 04 90
    0017F63D: 24 90
    0017F63E: E8 90
    0017F63F: 9D 90
    0017F640: DC 90
    0017F641: 00 90
    0017F642: 00 90

    Thank you so much, now its worked normal (y)

     

    No problem.
    Besides I don't recommend using 34k game. It has many, many bugs.
  11. I discovered that problem is in every quest and isnt in Mijago system. Any ideas?

    If you're using 34k game you can apply this diff:

     

    0017F637: 89 90
    0017F638: 5C 90
    0017F639: 24 90
    0017F63A: 04 90
    0017F63B: 89 90
    0017F63C: 04 90
    0017F63D: 24 90
    0017F63E: E8 90
    0017F63F: 9D 90
    0017F640: DC 90
    0017F641: 00 90
    0017F642: 00 90
    • Love 1
  12. Hello @Denis! Your quest gives me no errors although it's not working (pets arent summoning). Any thoughts?

    Btw, really good job. I would like to use it, if you know what can be wrong please message me.

     

    Regards.

    Everything's ok now. Once again thank you for the amazing work, it's really easy to edit which is why I find it very usefull.

×
×
  • 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.