Jump to content

npc.get_level game.core


Recommended Posts

#0  0x081bcf21 in quest::npc_get_level ()
No symbol table info available.
#1  0x083de96a in luaD_precall (L=0x65e4e0a0, func=0x65f81b24) at ldo.c:260
        ci = <value optimized out>
        n = <value optimized out>
        funcr = 1710758692
#2  0x083e6736 in luaV_execute (L=0x65e4e0a0) at lvm.c:627
        firstResult = <value optimized out>
        b = <value optimized out>
        nresults = <value optimized out>
        i = 32921
        base = 0x65f81b24
        ra = 0x65f81b24
        k = (TObject *) 0x2a14b800
        pc = (const Instruction *) 0x2a14b994
#3  0x083dec5d in resume (L=0x65e4e0a0, ud=0xffff8a64) at ldo.c:344
        firstResult = <value optimized out>
        nargs = <value optimized out>
        ci = <value optimized out>
#4  0x083de5eb in luaD_rawrunprotected (L=0x65e4e0a0, f=0x83dec30 <resume>,
    ud=0xffff8a64) at ldo.c:88
        lj = {previous = 0x0, b = {{_jb = {138274263, 1709498528, -30228,
        -30152, 1, 1, -60801, 0, 0, 0, 0, 687816960}}}, status = 0}

 

 

int npc_get_level(lua_State* L)
    {
        lua_pushnumber(L, CQuestManager::instance().GetCurrentNPCCharacterPtr()->GetLevel());
        return 1;
    }

 

 

local o_lv = npc.get_level()
			local m_lv = pc.get_level()
			local s_lv = pc.get_skill_level(165)
			local durum = pc.getqf("beceri_165")
			local sans = number(0,10)
			if m_lv - o_lv <= 5 or o_lv - m_lv <= 5 then
				if sans == 1 then
					pc.setqf("beceri_165",durum + 1 )
					if durum + 1 == 10 and pc.getqf("beceri_165_bitti") == 0 then
						if s_lv == 20 then
							pc.setqf("beceri_165_bitti",1)
						else
							syschat("Savaşçı Tecrübesi Yeteneğin "..(s_lv+1).." oldu.")
							pc.setqf("beceri_165",0)
							pc.set_skill_level(165, s_lv+1)
							affect.remove_collect(1, (s_lv)*100, 60*60*24*365*10)
							affect.add_collect(1, (s_lv+1)*100, 60*60*24*365*10)
						end
					else
						syschat("Savaşçı tecrübesi yeteneğinin gelişmesi için "..10-(durum+1).." puana ihtiyacın var.")
					end
				end
			end

 

i have an error this code. How i fix this ?

 

 

Edited by layfon
Link to comment
Share on other sites

  • Bronze
int npc_get_level(lua_State* L)
{
        lua_pushnumber(L, CQuestManager::instance().GetCurrentNPCCharacterPtr()->GetLevel());
        return 1;
}

Wrong.

int npc_get_level(lua_State * L)
{
        LPCHARACTER npc = CQuestManager::instance().GetCurrentNPCCharacterPtr();
        lua_pushnumber(L, npc ? npc->GetLevel() : 0);
        return 0;
}

Kind Regards

Ken

Edited by Ken
  • Love 1

Do not be sorry, be better.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



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