Register for your free account! | Forgot your password?

You last visited: Today at 18:51

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

Advertisement



[Sammelthread]40k function wishes

Discussion on [Sammelthread]40k function wishes within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Closed Thread
 
Old 01/13/2014, 09:29   #16
 
.Inya's Avatar
 
elite*gold: 50
Join Date: Mar 2013
Posts: 2,401
Received Thanks: 1,613
Quote:
Originally Posted by Dexam™ View Post
huhu,

eine funktion wie zum beispiel npc.get_animation("dead.msa") sowas eben^^.

ps.: danke für den thread ^^

mfg
Du meinst, dass er dann die animation ausführt?
.Inya is offline  
Old 01/13/2014, 10:05   #17
 
elite*gold: 0
Join Date: Jul 2010
Posts: 83
Received Thanks: 89
Make the function to destination mob type (npc.is_boss, npc.is_metinstone)
Adasaurus is offline  
Old 01/13/2014, 10:18   #18
 
.Inya's Avatar
 
elite*gold: 50
Join Date: Mar 2013
Posts: 2,401
Received Thanks: 1,613
Quote:
Originally Posted by Adasaurus View Post
Make the function to destination mob type (npc.is_boss, npc.is_metinstone)
Will be done as sone as im home
.Inya is offline  
Old 01/13/2014, 11:01   #19
 
[Castro]'s Avatar
 
elite*gold: 0
Join Date: Sep 2013
Posts: 166
Received Thanks: 104
was ganz wichtig wäre: item.get_attr & item.set_attr

Bin mir gradn icht sicher ob es die sogar gibt hab ich auf jedenfall noch nicht gefunden.

Sie sollte die Boni 1 - 5 bei einem Item hinzufügen bzw. mit item.get_attr in einer Tabelle ausgeben nach dem Schema:

Boni = {
[1] = {ID, WERT},
[2] = {ID, WERT},
...

wär denke ich nützlich.

MFG
[Castro] is offline  
Old 01/13/2014, 11:08   #20
 
.Inya's Avatar
 
elite*gold: 50
Join Date: Mar 2013
Posts: 2,401
Received Thanks: 1,613
Quote:
Originally Posted by [Castro] View Post
was ganz wichtig wäre: item.get_attr & item.set_attr

Bin mir gradn icht sicher ob es die sogar gibt hab ich auf jedenfall noch nicht gefunden.

Sie sollte die Boni 1 - 5 bei einem Item hinzufügen bzw. mit item.get_attr in einer Tabelle ausgeben nach dem Schema:

Boni = {
[1] = {ID, WERT},
[2] = {ID, WERT},
...

wär denke ich nützlich.

MFG
Wenn micht nicht alles irrt sind die ab der game_r34083 schon dabei.
.Inya is offline  
Old 01/13/2014, 14:58   #21
 
elite*gold: 0
Join Date: Jul 2009
Posts: 386
Received Thanks: 44
Schreibst auch Libs ?
siemka256 is offline  
Old 01/13/2014, 15:11   #22
 
.Inya's Avatar
 
elite*gold: 50
Join Date: Mar 2013
Posts: 2,401
Received Thanks: 1,613
Quote:
Originally Posted by siemka256 View Post
Schreibst auch Libs ?
Nein

nur für die Source erweiterungen
.Inya is offline  
Old 01/13/2014, 16:43   #23
 
elite*gold: 0
Join Date: Jan 2014
Posts: 268
Received Thanks: 373
item.set_attr() ist enthalten (s. item.set_value(attr_id, attr_type, attr_value)), item.get_attr() afaik nicht.

Kind Regards
Lefloyd is offline  
Old 01/13/2014, 16:47   #24
 
[Castro]'s Avatar
 
elite*gold: 0
Join Date: Sep 2013
Posts: 166
Received Thanks: 104
item.set_value ist doch für value 1 - 5 nicht für den Boni oder?
Also value0 - value4 sind nämlich (mag.) Angriffswerte.

Achja. Ich weiß nicht in wie weit das allein Serverside möglich ist. Aber ein Channelswitch sowie über den ingame channel switcher.
Falls sowas möglich wäre
[Castro] is offline  
Old 01/13/2014, 18:44   #25
 
elite*gold: 0
Join Date: Jan 2014
Posts: 268
Received Thanks: 373
Nein, item.set_value ist für die Bonis, 1-7 (oder 0-6 wie mans will). item.get_value dagegen ist für die Values (1-5). Warum Channelswitch per Server wenn es doch eh per Client geht? Per Server wäre genau gleich, nur dass der Client halt nur ein Packet senden würde und der Server den Rest selber ausführt - aber es wäre eigtl das gleiche^^

Kind Regards
Lefloyd is offline  
Old 01/13/2014, 18:48   #26
 
Noa_'s Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 605
Received Thanks: 580
hehe^^ da kann ich mich ja mit meine Ideen austoben *.*

Also ich hätte gern eine Funktion das ein npc sprechen lässt(ein Text über dem npc) wenn man sich ihn nährt.
Weitere Ideen folgen...
Noa_ is offline  
Old 01/13/2014, 18:48   #27
 
[Castro]'s Avatar
 
elite*gold: 0
Join Date: Sep 2013
Posts: 166
Received Thanks: 104
Quote:
Originally Posted by Lefloyd View Post
Nein, item.set_value ist für die Bonis, 1-7 (oder 0-6 wie mans will). item.get_value dagegen ist für die Values (1-5). Warum Channelswitch per Server wenn es doch eh per Client geht? Per Server wäre genau gleich, nur dass der Client halt nur ein Packet senden würde und der Server den Rest selber ausführt - aber es wäre eigtl das gleiche^^

Kind Regards
okay. Dann wäre eine Funktion wie item.get_attr ganz nützlich

Zum Thema Channel Switch:

Das ganze funktioniert Clientside zwar, hat aber häufig aussetzter.
[Castro] is offline  
Old 01/13/2014, 19:20   #28
 
elite*gold: 0
Join Date: Jan 2014
Posts: 268
Received Thanks: 373
item.get_attr (untested!):
Code:
	int item_get_attribute(lua_State* L)
	{
		CQuestManager& q = CQuestManager::instance();
		LPITEM item = q.GetCurrentItem();

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

		if (false == lua_isnumber(L, 1))
		{
			sys_err("index is not a number");
			lua_pushnumber(L, 0);
			return 1;
		}

		int index = lua_tonumber(L, 1);
		const TPlayerItemAttribute& attrItem = item->GetAttribute(index);
		
		lua_pushnumber(L, attrItem.bType);
		lua_pushnumber(L, attrItem.sValue);

		return 1;
	}
Lefloyd is offline  
Old 01/13/2014, 20:08   #29
 
.Inya's Avatar
 
elite*gold: 50
Join Date: Mar 2013
Posts: 2,401
Received Thanks: 1,613
PHP Code:
int npc_is_boss(lua_StateL)
    {
        
int vid CQuestManager::instance().GetCurrentNPCRace();
        
char szQuery[1024+1];
        
snprintf(szQuerysizeof(szQuery), "SELECT * FROM mob_proto WHERE vnum = %u and rank = 5 and type = 0"vid); 
        
std::auto_ptr<SQLMsgpMsg(DBManager::instance().DirectQuery(szQuery));
        if(
pMsg->Get()->uiNumRows 0){
            
lua_pushnumber(L1);
            return 
1;
        } else {
            
lua_pushnumber(L0);
            return 
0;
        }
    } 
Quest example:
PHP Code:
quest kill_test_level begin
    state start begin
        when kill begin
            
if npc.npc_is_boss() then
                chat
("Ja")
            else
                
chat("Nein")
            
end
        end
    end
end 
some kind of dirty solution but theres no clear definition whos boss and who not. If there is please say me ill correct it asap


item.get_attr_value:
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;
    } 

item.get_attr_type:
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;
    } 
Tested (2nd value selected):
thx to: Lefloyd
.Inya is offline  
Thanks
2 Users
Old 01/13/2014, 20:55   #30
 
elite*gold: 0
Join Date: Jan 2014
Posts: 268
Received Thanks: 373
Funktion: CHARACTER::GetMobRank()
Tabelle:
Code:
enum EMobRank
{
	MOB_RANK_PAWN,
	MOB_RANK_S_PAWN,
	MOB_RANK_KNIGHT,
	MOB_RANK_S_KNIGHT,
	MOB_RANK_BOSS,
	MOB_RANK_KING,
	MOB_RANK_MAX_NUM
};
siehe length.h.

Also:
Code:
	int npc_is_boss(lua_State* L)
	{
		LPCHARACTER npc = CQuestManager::instance().GetCurrentNPCCharacterPtr();
		if (npc->GetMobRank() == MOB_RANK_BOSS) {
			lua_pushboolean(L, 1);
			return 1;
		} else {
			lua_pushboolean(L, 0);
			return 1;
		}
	}
Kind Regards
Lefloyd is offline  
Thanks
1 User
Closed Thread


Similar Threads Similar Threads
Running Function 2 after Function 1 finished
09/15/2013 - AutoIt - 3 Replies
Hey, its me again. Im stuck on a problem since yesterday and as much as i hate to ask for help, i really dont know what else to try. I want Function 2 to run after Function 1 has finished. I tried GuiCtrlSetOnEvent and MsgLoop, but i dont really understand it. I tried to read tutorials but they didnt help at all. The line that are underline is what im talking about. I want gamestart() to run first and when its finished, i want iniviteteam() to run. #AutoIt3Wrapper_UseX64=n...
90 cap with ur wishes
07/10/2013 - SRO Private Server - 14 Replies
hey epvp community i detected to open an 90 cap server so you can write here should it old school ? only chin? or both races .. with costum edits or not tell me all ur wishes for the perfekt 90 cap server :) we will open the server when we got 50 player MAX THEY WANT TO play on it
[SAMMELTHREAD]Function
03/25/2013 - Metin2 PServer Guides & Strategies - 14 Replies
Functions ; function IsString(txt) if(txt == "") then return elseif(tostring(txt) != nil) then return 1 else return 0 end end
[Sammelthread]Pserver Tabels/Function und ihre Funktionen
02/15/2013 - 4Story - 4 Replies
Da viele Anfragen nach den und den Funktionen von Tabellen und Functions gibt hab ich mal ein Sammelthread aufgemacht Bitte keine Fragen hier /Please No Questions here Ich fang mal an TCASHTESTTABLE: um Leuten Cash zu geben TACCOUNT: Liste der Accounts TCHARTABLE(in TGLOBAL) Zuständig für die Anzeige der Accounts bei der Server Übersicht TCHARTABLE(in TGAME)



All times are GMT +2. The time now is 18:51.


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.