Jump to content

Quest Function - pc.get_exp_data()


Recommended Posts

M2 Download Center

This is the hidden content, please
( Internal )

Introduction & Small explaination

 

https://www.youtube.com/watch?v=RbhBA1Ko4x8

 

As you can see in the video, this function stores XP amount of the last killed mob.

Variable is reseted every time you login into the game (including warps).

 

##### HowTo #####

Spoiler

######## Open char.h and paste this in public class ########

Spoiler


int    GivenExpData;
int    GetExpData() const {return GivenExpData;}


######## Open char.cpp and find ########

Spoiler

void CHARACTER::Initialize()

Somewhere inside add this


GivenExpData = 0;


######## Open char_battle.cpp and find ########

Spoiler

to->PointChange(POINT_EXP, iExp, true);

 
make a new line and add


to->GivenExpData = iExp;


######## Open questlua_pc.cpp and add this function ########

Spoiler

int pc_get_exp_data(lua_State * L)
{
    lua_pushnumber(L, CQuestManager::instance().GetCurrentCharacterPtr()->GetExpData());
    return 1;
}

 
Somewhere at the end of RegisterPCFunctionTable paste


{"get_exp_data", pc_get_exp_data},


######## Test Quest ########
(notice that this version isn't the same as showed in the video)

Spoiler

quest exp begin
state start begin
    when kill with !npc.is_pc() begin
        chat(pc.get_exp_data().." EXP "..mob_name(npc.get_race()))
    end
end
end

 
Example of printed message (when you kill a mob)


999 EXP Wild Dog
  • Metin2 Dev 1
  • Love 9
Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...

Announcements



  • Similar Content

  • Similar Content

  • Similar Content

  • Tags

  • Activity

    1. 5

      Effect weapons

    2. 3

      Crystal Metinstone

    3. 3

      Feeding game source to LLM

    4. 113

      Ulthar SF V2 (TMP4 Base)

    5. 3

      Feeding game source to LLM

    6. 0

      Target Information System

    7. 3

      Feeding game source to LLM

    8. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.