[Sammelthread]40k function wishes

01/13/2014 21:26 .Inya#31
I need more Ideas :P

Add me at skype for more private ideas (if you dont want me to release them)
01/13/2014 21:27 Sphinx²#32
PHP Code:
       // misc.myqsl_update_query(string) - 'returns 0 for failed and 1 for successfull'
       
int misc_mysql_update_query(lua_StateL) {
        
char szQuery[1024];
        const 
char query lua_tostring(L1);
        
snprintf(szQuerysizeof(szQuery), "%s",query);
        
SQLMsg msg DBManager::instance().DirectQuery(szQuery);
        if(
msg) {
            
lua_pushnumber(L,1);
        } else {
            
sys_err("MySQL Query failed!");
            
lua_pushnumber(L,0);
        }
        
M2_DELETE(msg);
        return 
1;
    }

        
// misc.myqsl_query(string) - 'returns a lua mysql table'
    
int misc_mysql_query(lua_StateL) {
        
int i=0;
        
//MYSQL_FIELD *field;
        //MYSQL_ROW row;
        
char szQuery[1024];
        const 
char query lua_tostring(L1);
        
unsigned long long int num 0;
        
snprintf(szQuerysizeof(szQuery), "%s",query);
        
        
SQLMsg msg DBManager::instance().DirectQuery(szQuery);
        if(
msg) {
            
std::auto_ptr<SQLMsgpmsg(msg);
            
lua_newtable(L);
            while(
MYSQL_ROW row mysql_fetch_row(pmsg->Get()->pSQLResult)) {
                while(
MYSQL_FIELD field = (MYSQL_FIELD*)mysql_fetch_field(pmsg->Get()->pSQLResult) ) {
                    
lua_pushstring(L,field->name);
                    if (
sscanf(row[i],"%llu", &num)) 
                        
lua_pushnumber(Lnum 1.0);
                    else 
                        
lua_pushstring(L,row[i]);
                    
lua_rawset(L, -3);
                    
i++;            
                }
            }
            return 
1;
        } else {
            
sys_err("MySQL Query failed!");
            
lua_pushnumber(L,0);
        }
        return 
0;
    }

        
// misc.myqsl_real_escape_string(string) - 'returns an escaped string'
    
int misc_mysql_real_escape_string(lua_StateL) {
        
charcescapedstring = new char[strlen(lua_tostring(L,1)) * 1];
        
DBManager::instance().EscapeString(cescapedstring,strlen(lua_tostring(L,1))*2+1,lua_tostring(L,1),strlen(lua_tostring(L,1)));
        
lua_pushstring(L,cescapedstring);
        return 
1;
    } 
PHP Code:
        luaL_reg misc_functions[] = 
        {
            {
"mysql_real_escape_string"misc_mysql_real_escape_string},
            {
"mysql_query"misc_mysql_query},
            {
"mysql_update_query"misc_mysql_update_query},
            {
NULLNULL}
        };

        
CQuestManager::instance().AddLuaFunctionTable("misc"misc_functions); 
// Ihr braucht eine neue LUA Function Table namens misc.
// 1. Option - Einfach normale Quest Funktionen adden
// 2. Neue CPP Datei 'questlua_misc.cpp'
01/13/2014 22:11 Dexam™#33
Quote:
Originally Posted by .InyaProduction View Post
Du meinst, dass er dann die animation ausführt?
ja genau, dass man die animation sozusagen festlegen kann.
01/14/2014 00:46 Sphinx²#34
Quote:
Originally Posted by Dexam™ View Post
ja genau, dass man die animation sozusagen festlegen kann.
PHP Code:
        // Not tested
        // npc.motion(byte)
    
int npc_motion(lua_StateL) {
        if (!
lua_isnumber(L1))
        {
            
sys_err("QUEST : wrong argument");
            return 
0;
        }
        
        
CQuestManagerCQuestManager::instance();
        
LPCHARACTER npc q.GetCurrentNPCCharacterPtr();
        if (
npc && npc->IsPC()) {
            
BYTE motionid lua_tonumber(L1);
            
npc->Motion(motionid);
            
lua_pushboolean(L1);
        } else {
            
lua_pushboolean(L0);
        }
        return 
1;
    } 
PHP Code:
 "motion",            npc_motion            }, 
Ich habe es nicht getestet.
01/14/2014 09:39 .Inya#35
Quote:
Originally Posted by Sphinx² View Post
PHP Code:
        // Not tested
        // npc.motion(byte)
    
int npc_motion(lua_StateL) {
        if (!
lua_isnumber(L1))
        {
            
sys_err("QUEST : wrong argument");
            return 
0;
        }
        
        
CQuestManagerCQuestManager::instance();
        
LPCHARACTER npc q.GetCurrentNPCCharacterPtr();
        if (
npc && npc->IsPC()) {
            
BYTE motionid lua_tonumber(L1);
            
npc->Motion(motionid);
            
lua_pushboolean(L1);
        } else {
            
lua_pushboolean(L0);
        }
        return 
1;
    } 
PHP Code:
 "motion",            npc_motion            }, 
Ich habe es nicht getestet.
#added
01/14/2014 13:11 Sujino#36
Maybe a Questfunction to get the result of a duel?

pc.get_duel_result()

Dont know if it work without some input like EnemyID or something
01/14/2014 13:39 MartPwnS#37
Diese Sektion muss sterben bevor das weitergeht^^
01/14/2014 13:45 .Inya#38
Quote:
Originally Posted by MartPwnS View Post
Diese Sektion muss sterben bevor das weitergeht^^
Und selber im Hintergrund an der Source arbeiten stimmts? Diese Sektion hat sich keineswegs aufgrund der Source verschlimmert (bis jetzt) es gab diese Paar Tage Aufruhr beim Release und gut ist. Nehmen wir die Situation wie sie momentan ist.
Was ich für einen Zusammenbruch halte ist die Situation, in der die ersten Kiddys rausfinden, wie man die Exe compiled und Viren einbauen. Dann ist die Sektion dem Untergang geweiht. Trotzdem arbeite ich an dem von mir angekündigten Projekt weil mittlerweile ist hier echt.. naja ich sprechs nicht aus. Liegt aber nicht an der Source
01/14/2014 13:58 .N0N4M3.#39
Quote:
Originally Posted by .InyaProduction View Post
Was ich für einen Zusammenbruch halte ist die Situation, in der die ersten Kiddys rausfinden, wie man die Exe compiled [...]
Coole Idee. Gleich mal ein Tutorial anfertigen ;)
01/14/2014 14:00 .Inya#40
Quote:
Originally Posted by .N0N4M3. View Post
Coole Idee. Gleich mal ein Tutorial anfertigen ;)
Mach doch :D dann müssen sie erst nochmal rausfinden wie man nen Virus anfertigt und den in den clienten bekommt ohne dass der Virenscanner den in stücke reißt
01/14/2014 14:08 lollo_9_1#41
Quote:
Originally Posted by Sphinx² View Post
Code:
					if (sscanf(row[i],"%llu", &num))
Bugs are coming -> Everything that begins with a digit will turn into a number 127.0.0.1 -> "127" || "4all" -> "4"
01/14/2014 14:21 lolor2#42
Quote:
Originally Posted by .InyaProduction View Post
Und selber im Hintergrund an der Source arbeiten stimmts? Diese Sektion hat sich keineswegs aufgrund der Source verschlimmert (bis jetzt) es gab diese Paar Tage Aufruhr beim Release und gut ist. Nehmen wir die Situation wie sie momentan ist.
Was ich für einen Zusammenbruch halte ist die Situation, in der die ersten Kiddys rausfinden, wie man die Exe compiled und Viren einbauen. Dann ist die Sektion dem Untergang geweiht. Trotzdem arbeite ich an dem von mir angekündigten Projekt weil mittlerweile ist hier echt.. naja ich sprechs nicht aus. Liegt aber nicht an der Source
Ich glaube sogar das sie sich noch mehr zusammengeschweißt hat zumindest ist es ja bei uns so stimmts?:D
viele Menschen viele Länder und dennoch keine Streitereien so wie wir es mögen :D
01/14/2014 14:29 .Inya#43
Quote:
Originally Posted by lolor2 View Post
Ich glaube sogar das sie sich noch mehr zusammengeschweißt hat zumindest ist es ja bei uns so stimmts?:D
viele Menschen viele Länder und dennoch keine Streitereien so wie wir es mögen :D
Joa die truppe ist schon ganz lustig :P vorallem kann ich da gleich mal mein Englisch ein wenig auffrischen ^-^ Und endlich mal keiner dabei der sich beschwert wenn man sich in der gruppe übers coden unterhält weil er nix versteht xD
01/14/2014 16:01 Sphinx²#44
Quote:
Originally Posted by lollo_9_1 View Post
Bugs are coming -> Everything that begins with a digit will turn into a number 127.0.0.1 -> "127" || "4all" -> "4"
Uhm... I will test it.
If its true I will rewrite it.
01/14/2014 16:16 MartPwnS#45
könnt ihr ja gerne machen, aber ein forum wie epvp ist da einfach der falsche Platz, soll jetzt keine Fremdwerbung sein, aber sucht euch doch ein privates Forum, dass euch im Problemfall nichts passieren kann :)