Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2 > Metin2 Private Server
You last visited: Today at 13:26

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[40k/Src]item.get_attr function gesucht

Discussion on [40k/Src]item.get_attr function gesucht within the Metin2 Private Server forum part of the Metin2 category.

Reply
 
Old   #1
 
holosko74's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 267
Received Thanks: 103
[40k/Src]item.get_attr function gesucht

hallo,

da ich vorher die vanilla game hatte und jzt 40k game source suche ich nach diesen function in der vanilla ist es die:

item.get_attr_type
item.get_attr_value

bei den 40k was brauch ich da und wo muss ich die neue einfügen?

danke im vorraus und nen schönen abend wünsche ich euch
holosko74 is offline  
Old 08/25/2015, 02:24   #2


 
xXGaardenXx's Avatar
 
elite*gold: 26
Join Date: Jan 2009
Posts: 1,175
Received Thanks: 469
Such in der questlua_item.cpp nach (Zeile 461 bei mir) :

PHP Code:
int item_copy_and_give_before_remove(lua_StateL)
    {
        
lua_pushboolean(L0);
        if (!
lua_isnumber(L1))
            return 
1;

        
DWORD vnum = (DWORD)lua_tonumber(L1);

        
CQuestManagerCQuestManager::instance();
        
LPITEM pItem q.GetCurrentItem();
        
LPCHARACTER pChar q.GetCurrentCharacterPtr();

        
LPITEM pkNewItem ITEM_MANAGER::instance().CreateItem(vnum10false);

        if (
pkNewItem)
        {
            
ITEM_MANAGER::CopyAllAttrTo(pItempkNewItem);
            
LogManager::instance().ItemLog(pCharpkNewItem"COPY SUCCESS"pkNewItem->GetName());

            
BYTE bCell pItem->GetCell();

            
ITEM_MANAGER::instance().RemoveItem(pItem"REMOVE (COPY SUCCESS)");

            
pkNewItem->AddToCharacter(pCharTItemPos(INVENTORYbCell)); 
            
ITEM_MANAGER::instance().FlushDelayedSave(pkNewItem);
            
pkNewItem->AttrLog();

            
// ¼º°ø!
            
lua_pushboolean(L1);            
        }

        return 
1;
    } 

Füg darunter Die beiden Funktionen ein :


PHP Code:
int item_get_attr_type(lua_StateL)
    {
        
CQuestManagerCQuestManager::instance();
        
LPITEM item q.GetCurrentItem();

        if (!
item)
        {
            
sys_err("cannot get current item");
            
lua_pushnumber(L0);
            return 
1;
        }

        if (
false == lua_isnumber(L1))
        {
            
sys_err("index is not a number");
            
lua_pushnumber(L0);
            return 
1;
        }

        
int index lua_tonumber(L1);
        const 
TPlayerItemAttributeattrItem item->GetAttribute(index);
        
        
lua_pushnumber(LattrItem.bType);

        return 
1;
    } 
PHP Code:
    int item_get_attr_value(lua_StateL)
    {
        
CQuestManagerCQuestManager::instance();
        
LPITEM item q.GetCurrentItem();

        if (!
item)
        {
            
sys_err("cannot get current item");
            
lua_pushnumber(L0);
            return 
1;
        }

        if (
false == lua_isnumber(L1))
        {
            
sys_err("index is not a number");
            
lua_pushnumber(L0);
            return 
1;
        }

        
int index lua_tonumber(L1);
        const 
TPlayerItemAttributeattrItem item->GetAttribute(index);
            
        
lua_pushnumber(LattrItem.sValue);

        return 
1;
    } 
& nun suchst du nach luaL_Reg item_functions[] = : und fügst Folgendes ein :

PHP Code:
"get_attr_type",        item_get_attr_type},
"get_attr_value",        item_get_attr_value}, 
xXGaardenXx is offline  
Thanks
2 Users
Old 08/25/2015, 11:42   #3
 
elite*gold: 2
Join Date: Jun 2013
Posts: 1,063
Received Thanks: 1,725
du hast die item_get_attr_value vergessen, bzw hast die falsche reingestellt.
ProfessorEnte is offline  
Thanks
2 Users
Old 08/25/2015, 14:40   #4
 
holosko74's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 267
Received Thanks: 103
Quote:
Originally Posted by xXGaardenXx View Post
Such in der questlua_item.cpp nach (Zeile 461 bei mir) :

PHP Code:
int item_copy_and_give_before_remove(lua_StateL)
    {
        
lua_pushboolean(L0);
        if (!
lua_isnumber(L1))
            return 
1;

        
DWORD vnum = (DWORD)lua_tonumber(L1);

        
CQuestManagerCQuestManager::instance();
        
LPITEM pItem q.GetCurrentItem();
        
LPCHARACTER pChar q.GetCurrentCharacterPtr();

        
LPITEM pkNewItem ITEM_MANAGER::instance().CreateItem(vnum10false);

        if (
pkNewItem)
        {
            
ITEM_MANAGER::CopyAllAttrTo(pItempkNewItem);
            
LogManager::instance().ItemLog(pCharpkNewItem"COPY SUCCESS"pkNewItem->GetName());

            
BYTE bCell pItem->GetCell();

            
ITEM_MANAGER::instance().RemoveItem(pItem"REMOVE (COPY SUCCESS)");

            
pkNewItem->AddToCharacter(pCharTItemPos(INVENTORYbCell)); 
            
ITEM_MANAGER::instance().FlushDelayedSave(pkNewItem);
            
pkNewItem->AttrLog();

            
// ¼º°ø!
            
lua_pushboolean(L1);            
        }

        return 
1;
    } 

Füg darunter Die beiden Funktionen ein :


PHP Code:
int item_get_attr_type(lua_StateL)
    {
        
CQuestManagerCQuestManager::instance();
        
LPITEM item q.GetCurrentItem();

        if (!
item)
        {
            
sys_err("cannot get current item");
            
lua_pushnumber(L0);
            return 
1;
        }

        if (
false == lua_isnumber(L1))
        {
            
sys_err("index is not a number");
            
lua_pushnumber(L0);
            return 
1;
        }

        
int index lua_tonumber(L1);
        const 
TPlayerItemAttributeattrItem item->GetAttribute(index);
        
        
lua_pushnumber(LattrItem.bType);

        return 
1;
    } 
PHP Code:
int item_set_attr(lua_StateL)
    {
        
CQuestManagerCQuestManager::instance();
        
LPITEM item q.GetCurrentItem();

        if (!
item)
        {
            
sys_err("item_set_attr: cannot get current item");
            
lua_pushboolean(L0);
            return 
1;
        }

        if (
false == lua_isnumber(L1))
        {
            
sys_err("item_set_attr: first argument must be attr_id");
            
lua_pushboolean(L0);
            return 
1;
        }
        
int vnum lua_tonumber(L1);
        
        if (
false == lua_isnumber(L2))
        {
            
sys_err("item_set_attr: second argument must be attr_value");
            
lua_pushboolean(L0);
            return 
1;
        }
        
int value lua_tonumber(L2);
        
int pos 0;
        
        if (
true == lua_isnumber(L3))
        {
            
pos lua_tonumber(L3);
        }
        
        
item->SetAttribute(pos, (BYTE)vnum, (short)value);
        
        
lua_pushboolean(L1);
        return 
1;
        
    } 
& nun suchst du nach luaL_Reg item_functions[] = : und fügst Folgendes ein :

PHP Code:
"get_attr_type",        item_get_attr_type},
"get_attr_value",        item_get_attr_value}, 

Danke dir fehlt nur item.get_attr_value wie mein vor poster es gesagt hat
holosko74 is offline  
Thanks
1 User
Old 08/25/2015, 16:25   #5


 
xXGaardenXx's Avatar
 
elite*gold: 26
Join Date: Jan 2009
Posts: 1,175
Received Thanks: 469
Quote:
Originally Posted by ProfessorEnte View Post
du hast die item_get_attr_value vergessen, bzw hast die falsche reingestellt.
Im ersten Beitrag nun auch die Richtige eingefügt

Hier nochmal die Richtige war gestern schon zu spät

PHP Code:
    int item_get_attr_value(lua_StateL)
    {
        
CQuestManagerCQuestManager::instance();
        
LPITEM item q.GetCurrentItem();

        if (!
item)
        {
            
sys_err("cannot get current item");
            
lua_pushnumber(L0);
            return 
1;
        }

        if (
false == lua_isnumber(L1))
        {
            
sys_err("index is not a number");
            
lua_pushnumber(L0);
            return 
1;
        }

        
int index lua_tonumber(L1);
        const 
TPlayerItemAttributeattrItem item->GetAttribute(index);
            
        
lua_pushnumber(LattrItem.sValue);

        return 
1;
    } 
xXGaardenXx is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[LIB]Item2, PC2 (set_attr, get_attr, equip, set_level und mehr)
06/18/2014 - Metin2 PServer Guides & Strategies - 58 Replies
Hey, Lib enthält folgende Funktionen/Lib contains the following functions: # function(arguments) -- return type - notes item2.get_wearflag() -- int item2.is_wearflag(WEAR_FLAG) -- bool item2.set_attr(index, type, value) -- bool item2.get_attr(index) -- int, int item2.equip(slot) -- bool - equips the current item to the wearslot "slot" pc2.give_or_drop_item_and_select(int vnum||string item_name) -- official function
Auto item drop function.
04/12/2011 - Conquer Online 2 - 2 Replies
Ive been waiting for this for such a long time: A program that drops items in ur bag accept for special ones (+1, elite, super, mets, dbs, etc). I guess its not impossible to make because bots can do it to. I guess it would work by pressing ctrl+d (drop) and then it would auto drop 9 items in a second. Without opening my bag or loosing control over my mouse. Does anyone have such a problem or can make one? Ive serched trought the forum but coudnt find it (sorry if im wrong) Would be...
[HELP] CoEmu - Use item function
05/31/2009 - CO2 Private Server - 3 Replies
Hey. I make a class money bag. Have 1 problem. Here is my code: So what is my problem? Function Dont work how to fix it? please help me.



All times are GMT +2. The time now is 13:26.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.