Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/16/14 in all areas

  1. Hey Guys, Since this is my first post i want to release a little module i wrote 5 minutes ago. First of all this is for everybody who hates sockets(like me) and don't want to use item_proto for Shinings/Effects whatever. The Code is quiet "crappy" but it is working flawlessly. So lets get started. You wanna create something like this where you declare your maps to store the vnum and effectfilepath #include <map> #ifndef ShiningSettings_H #define ShiningSettings_H 1 extern std::map<int, char*> shiningdata; extern std::map<int, char*>::iterator shiningit; #endif Then you wanna create your function for your python module #include "StdAfx.h" #include "ShiningSettings.h" PyObject* addEffect(PyObject* poSelf, PyObject* poArgs) { int vnum; char* effectpath; if(!PyTuple_GetInteger(poArgs, 0, &vnum)) { return Py_BuildException(); } if(!PyTuple_GetString(poArgs, 1, &effectpath)) { return Py_BuildException(); } if(!shiningdata.count(vnum)){ shiningdata[vnum] = effectpath; } return Py_BuildNone(); } void initShining() { static PyMethodDef s_methods[] = { { "Add", addEffect, METH_VARARGS }, { NULL, NULL }, }; Py_InitModule("Shining", s_methods); } Make also sure you start your function in UserInterface.cpp bool RunMainScript(CPythonLauncher& pyLauncher, const char* lpCmdLine){ //Otherfunctions initShining(); } AND in stdafx.h add this void initShining(); After that open up your InstanceBase.cpp and define your early declared maps also include boost algorithm Just copy this at the start of the file #include "boost/algorithm/string.hpp" std::map<int, char*> shiningdata; std::map<int, char*>::iterator shiningit; Then search for if (12010 <= vnum && vnum <= 12049) and copy the following code after the if-clause if(!shiningdata.empty()){ for (shiningit=shiningdata.begin(); shiningit!=shiningdata.end(); shiningit++) if (shiningit->first == vnum) { std::string substr(shiningit->second); std::vector<string> chars; boost::split(chars, substr, boost::is_any_of("#")); for(std::vector<string>::size_type i = 0; i != chars.size(); i++) { __AttachEffectToArmours(chars[i]); } } } } This will split after a # for multiple shining attached to one amour. Then you need to declare and define a function in InstanceBaseEffect.cpp and InstanceBase.h InstanceBaseEffect.cpp DWORD CInstanceBase::__AttachEffectToArmours(string effectfilename) { const char * effectpath = effectfilename.c_str(); CEffectManager::Instance().RegisterEffect(effectpath, false, false); return m_GraphicThingInstance.AttachEffectByName(0, "Bip01", effectpath); } Again if you wish you can modify it. I already hardcoded the bonename and the boneindex. In InstanceBase.h Search for this: protected: DWORD __AttachEffect(UINT eEftType); DWORD __AttachEffectToArmours(string effectfilename); void __DetachEffect(DWORD dwEID); Replace with this: protected: DWORD __AttachEffect(UINT eEftType); DWORD __AttachEffectToArmours(string effectfilename); DWORD __AttachEffect(char filename[128]); void __DetachEffect(DWORD dwEID); Oh Yeah watch out that your filename is no longer than 128 characters. Last but not least: Create a Python Script in your root Folder (call it whatever you like) import Shining ##Modded Version # Implemented Delim for C++ # delimiter : # EffectTable = { 11290 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse"], 11291 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse"], 11292 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse"], 11293 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse"], 11294 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse"], 11295 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse"], 11296 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse"], 11297 : ["d:/ymir work/pc/common/effect/armor/grun_shining.mse#d:/ymir work/pc/common/effect/armor/armor-4-2-1.mse"], 11298 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse#d:/ymir work/pc/common/effect/armor/armor-4-2-1.mse"], 11299 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse#d:/ymir work/pc/common/effect/armor/armor-4-2-1.mse"], 11259 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse#d:/ymir work/pc/common/effect/armor/armor-4-2-1.mse"], 11269 : ["d:/ymir work/pc/common/effect/armor/armor-4-2-2.mse#d:/ymir work/pc/common/effect/armor/armor-4-2-1.mse"] } def LoadEffectTable(): for effect in EffectTable: for i in range(len(EffectTable[effect])): vnum = effect effectpath = EffectTable[effect][i] Shining.Add(vnum, effectpath) As you can see 2 Shinings are seperated with an "#". Last but no least import your file in your game and add the following line under the python constructor effecttable.LoadEffectTable() I Hope i didn't forgot anything
    3 points
  2. M2 Download Center Download Here ( Internal ) I am proud to release exclusively for metin2dev -with the blessing from its author Tim Niederhausen- the latest version of the original FileArchiver command line tool, which is now divided into two Windows executables: FileArchiver_Eterpack (r3869) This command line tool can pack and unpack EterPack (epk) files. Types 0, 1, 2 and 3 are supported for the packing function. Parameters are configured through xml files: FileArchiver_Eterpack.exe rootpack.xml Optionally you can drag and drop the xml file over FileArchiver_Eterpack.exe in Windows Vista and higher. Unpacking Example XML: unpack root.epk to the folder root_unpacked. ArchivePath is the path to the packed file (without extension) and OutputPath is the folder where files should be written. <ScriptFile> <ExtractEterPack ArchivePath="root" OutputPath="root_unpacked/" CreateXml="No" /> </ScriptFile> Example XML: unpack a series of epk files, creating a xml file that we can use to pack them back later with FA. CreateXml and XmlPath elements are self explanatory here. <ScriptFile> <ExtractEterPack ArchivePath="yt2/pack/uiloading" OutputPath="yt2_unpacked/" CreateXml="Yes" XmlPath="uiloading_pack.xml" /> <ExtractEterPack ArchivePath="yt2/pack/etc" OutputPath="yt2_unpacked/" CreateXml="Yes" XmlPath="etc_pack.xml" /> <ExtractEterPack ArchivePath="yt2/pack/uiscript" OutputPath="yt2_unpacked/" CreateXml="Yes" XmlPath="uiscript_pack.xml" /> </ScriptFile> Packing Example XML: Create uiloading.epk with Type 2 (LZO packed and XTEA key); note how ArchivePath is the path to write the packed file, ArchivedPath is the absolute path of each file in the Metin2 virtual filesystem, while CDATA is the actual location of the file in our PC (relative or absolute) <ScriptFile> <CreateEterPack ArchivePath="../bin/pack/uiloading"> <File ArchivedPath="d:/ymir work/uiloading/loading0.jpg" Type="2"><![CDATA[uiloading/loading0.jpg]]></File> <File ArchivedPath="d:/ymir work/uiloading/loading1.jpg" Type="2"><![CDATA[uiloading/loading1.jpg]]></File> <File ArchivedPath="d:/ymir work/uiloading/loading2.jpg" Type="2"><![CDATA[uiloading/loading2.jpg]]></File> <File ArchivedPath="d:/ymir work/uiloading/loading3.jpg" Type="2"><![CDATA[uiloading/loading3.jpg]]></File> <File ArchivedPath="d:/ymir work/uiloading/loading4.jpg" Type="2"><![CDATA[uiloading/loading4.jpg]]></File> <File ArchivedPath="d:/ymir work/uiloading/loading5.jpg" Type="2"><![CDATA[uiloading/loading5.jpg]]></File> <File ArchivedPath="d:/ymir work/uiloading/loading6.jpg" Type="2"><![CDATA[uiloading/loading6.jpg]]></File> <File ArchivedPath="d:/ymir work/uiloading/loading7.jpg" Type="2"><![CDATA[uiloading/loading7.jpg]]></File> </CreateEterPack> </ScriptFile> Example XML: Create a Type 3 (Panama) file. IvPath contains the path to a 32 byte file that will be used as key. Obviously, you should not share this file. This encryption requires a server part which is explained below. <ScriptFile> <CreateEterPack ArchivePath="../bin/pack/metin2_mypatch" IvPath="iv/mypatch.iv"> <File ArchivedPath="d:/ymir work/pc/assassin/assassin_5_1.gr2" Type="3"><![CDATA[pc/assassin/assassin_5_1.gr2]]></File> <File ArchivedPath="d:/ymir work/pc/assassin/assassin_5_1.dds" Type="3"><![CDATA[pc/assassin/assassin_5_1.dds]]></File> <File ArchivedPath="d:/ymir work/pc/assassin/assassin_5_1_lod_01.gr2" Type="3"><![CDATA[pc/assassin/assassin_5_1_lod_01.gr2]]></File> <File ArchivedPath="d:/ymir work/pc/assassin/assassin_5_1_lod_02.gr2" Type="3"><![CDATA[pc/assassin/assassin_5_1_lod_02.gr2]]></File> <File ArchivedPath="d:/ymir work/pc/assassin/assassin_5_1_lod_03.gr2" Type="3"><![CDATA[pc/assassin/assassin_5_1_lod_03.gr2]]></File> </CreateEterPack> </ScriptFile> Panama encryption: serverside setup Once you have your Panama encrypted packs, you need to upload the keys to auth/panama along with a text file called panama.lst containing a list of files to be decrypted with their respective key file, separated by tabs. Example panama.lst file: pack/mypatch mypatch.iv pack/terrainmaps terrainmaps.iv pack/tree tree.iv Caveats: you can not encrypt the root with panama. Also, if a pack encrypted with panama contains armors or hairstyles, these may not appear in the character selection screen. FileArchiver_Proto (r2806) This tool also takes an xml file as parameter and is intended to read and write clientside item_proto and mob_proto files. Example XML: Read a clientside, packed item_proto and write it to to a xml file <ScriptFile> <ReadItemProto ItemProtoPath="item_proto" OutputPath="item_proto.xml" /> </ScriptFile> Example XML: Write back, once edited, our XML file as a packed item_proto file. <ScriptFile> <WriteItemProto ItemProtoPath="item_proto" InputPath="item_proto.xml" /> </ScriptFile> Now for the mob_proto (Only use the Proto archiver for this one!!!): To extract it from the client use this XML <ScriptFile> <mob_proto_extract path="mob_proto" output="mob_proto.xml" /> </ScriptFile> To pack it back use this one: <ScriptFile> <mob_proto_create path="mob_proto.xml" output="mob_proto_edited" /> </ScriptFile> For questions and comments, you can post in this same thread.
    1 point
  3. M2 Download Center Download Here ( Internal ) Hello everyone! I've made this map for e*** to christmas.. Now i can public it here... I hope you like it.. Maybe it has some bugs, i won't fix it.. i haven't time for it.. but i hope that no.. Have fun!
    1 point
  4. time.sleep is equal with thread.sleep in common program languages and that is not equal with timer. For timer you can use the default OnUpdate function or use the official one: [Hidden Content]
    1 point
  5. def __init__(self): is the python constructor def __del__(self): is the python deconstructor
    1 point
  6. It's still ongoing. Yeah, I managed to do some work on qc but it'll take some more time. My qc is now able to read some basic stuff but it got problems when reading most functions, that's when it always throws syntax error. But I was able to compile a cute, small quest with just an assert.
    1 point
  7. Don't forget that.. when 11000.chat."Andamento della tua Gilda" ... with pc.hasguild() begin guild.get_name(pc.get_guild())
    1 point
  8. test this; guild.get_name(guild.get_id ? ()) i test this later... sry and now i go sleeping ^^
    1 point
  9. Your String is correct but i have no idea why is not works... test this; --[[quest guild_ranking 2006 riscritta decentemente da nabbhacker per newage2]] quest guild_ranking begin state start begin when 11000.chat."Andamento della tua Gilda" or 11002.chat."Andamento della tua Gilda" or 11004.chat."Andamento della tua Gilda" begin local name = mob_name(npc.get_race())..":" say_title(name) say("Classifica:[DELAY value;0]"); say(" | Nome | Punti | Vit. | Sconfitte | Pareggi "); say(guild.around_ranking_string().."[/DELAY]") wait() say_title(name) say("Prestazioni della tua Gilda ed informazioni:[ENTER]") --don't work begin --[[ say(string.format("Nome Gilda:%s ;", guild.get_name())) say(string.format("Livello:%d ;", guild.get_level())) say(string.format("Numero Membri:%d ;", guild.get_member_count())) say(string.format("Guerre Combattute:%d: ;", guild.get_any_war())) say(string.format("Posizione Classifica:%d ;", guild.get_rank())) ]] say("Nome Gilda: "..guild.get_name().."") say("Livello: "..guild.get_level().."") say("Numero Membri: "..guild.get_member_count().."") say("Guerre Combattute: "..guild.get_any_war().."") say("Posizione Classifica: "..guild.get_rank().."") --don't work end end -- when when 11000.chat."Andamento Top Gilde" or 11002.chat."Andamento Top Gilde" or 11004.chat."Andamento Top Gilde" begin local name = mob_name(npc.get_race())..":" say_title(name) say("Classifica:[DELAY value;0]"); say(" | Nome | Punti | Vit. | Sconfitte | Pareggi "); say(guild.high_ranking_string().."[/DELAY]") end -- when end -- state end -- quest
    1 point
×
×
  • 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.