Jump to content
metin2dev

Search the Community

Showing results for tags 'lua' in content posted in Programming / Scripts.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Community
    • Announcements
    • Feedback
  • Metin2
    • General
    • Questions and Answers
    • Guides & HowTo
    • Design
    • Private Servers
    • Services
    • Videos
  • Releases
    • General
    • Tools
    • Programming / Scripts
    • Quests
    • Binaries & Clients/Serverfiles
    • 3D Models
    • 2D Graphics
    • Operating Systems
  • Safe Zone
    • Offtopic
    • Games Talk
    • Music/Videos/Art

Categories

There are no results to display.

There are no results to display.


Found 7 results

  1. (Video at the end) Lockpicking is the new system which allows you to train special ability. This ability upgrade your skill of opening new boxes which are on maps(like npc). Every level gives higher chance to open box and probability to get more rewards. To train Lockpicking skill players have to read special books. You can set the level from which players can use this system. Maximum level of skill is 40, but it's configurable. Player can check how many boxes found. System support multilang servers. Missions Additionaly you will get special missions for this sytem, you can easily configure them or add new ones(just add new item to the table). After finished mission player receive reward directly in Quest Scroll. Configuration ItemShop Also you can earn some money from itemshop by this system : ) Magical key rises you chance to open box to 100%, but count of items which you can get from box still depends on skill level. The Key can be used only 10 times. Download & Scan http://www19.zippyshare.com/v/ECjEXsuj/file.html https://www.virustotal.com/#/file/d4fb8b52a8ed74f3a2fbf74efdbd2cc2c042ed82b243fea4d7d18561fa206750/detection
  2. lua Emotions for party

    Emotions for party By this system your players now are able to start emotion in same time for all party members. When party leader choose emotion then you will see counter like in image bellow. You will able to open emotion menu in System Options. To open emotions menu player have to be a party leader To start emotions all party members must be near party leader. You can simply add new own emotions, change timer lenght, set own emotion name(in menu) or disable some emotions without deleting them. Download & Scan http://www10.zippyshare.com/v/vjfpebgh/file.html https://www.virustotal.com/#/file/24c3d2b2579ecefa2dda0e783eddd145fa456d97a2d17989246e83f266f19199
  3. In 17.5 GF update with Talismans GF also introduce new type of bonuses - strong against weapons So here's it! I'm not 100% sure about bonuses numbers cuz in my revision i have also other new bonuses. Server Side open service.h and add: #define ENABLE_BONUS_STRONG_AGAINST_WEAPON open length.h, find APPLY_ANTI_PENETRATE_PCT, (or last of urs bonuses) add bellow: #ifdef ENABLE_BONUS_STRONG_AGAINST_WEAPON APPLY_ATTBONUS_SWORD, // 92 APPLY_ATTBONUS_TWOHANDED, // 93 APPLY_ATTBONUS_DAGGER, // 94 APPLY_ATTBONUS_BELL, // 95 APPLY_ATTBONUS_FAN, // 96 APPLY_ATTBONUS_BOW, // 97 #endif open ProtoReader.cpp and find "APPLY_ANTI_PENETRATE_PCT", (or last of urs bonuses) add bellow: #ifdef ENABLE_BONUS_STRONG_AGAINST_WEAPON , "APPLY_ATTBONUS_SWORD" "APPLY_ATTBONUS_TWOHANDED", "APPLY_ATTBONUS_DAGGER", "APPLY_ATTBONUS_BELL", "APPLY_ATTBONUS_FAN", "APPLY_ATTBONUS_BOW" #endif open Battle.cpp and inf int CalcAttBonus find: if (pkAttacker->IsNPC() && pkVictim->IsPC()) { iAtk = (iAtk * CHARACTER_MANAGER::instance().GetMobDamageRate(pkAttacker)) / 100; } add bellow: #ifdef ENABLE_BONUS_STRONG_AGAINST_WEAPON if (pkVictim->IsPC()) { LPITEM pkWeapon = pkVictim->GetWear(WEAR_WEAPON); if (pkWeapon) { switch (pkWeapon->GetSubType()) { case WEAPON_SWORD: iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_SWORD)) / 100; break; case WEAPON_TWO_HANDED: iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_TWOHANDED)) / 100; break; case WEAPON_DAGGER: iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_DAGGER)) / 100; break; case WEAPON_BELL: iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_BELL)) / 100; break; case WEAPON_FAN: iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_FAN)) / 100; break; case WEAPON_BOW: iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_BOW)) / 100; break; } } } #endif in char.cpp find: case POINT_ATTBONUS_DEVIL: // 47 add bellow: #ifdef ENABLE_BONUS_STRONG_AGAINST_WEAPON case POINT_ATTBONUS_SWORD: case POINT_ATTBONUS_TWOHANDED: case POINT_ATTBONUS_DAGGER: case POINT_ATTBONUS_BELL: case POINT_ATTBONUS_FAN: case POINT_ATTBONUS_BOW: #endif find(in CHARACTER::ApplyPoint): case APPLY_ATTBONUS_MONSTER: // 63 add bellow: #ifdef ENABLE_BONUS_STRONG_AGAINST_WEAPON case APPLY_ATTBONUS_SWORD: case APPLY_ATTBONUS_TWOHANDED: case APPLY_ATTBONUS_DAGGER: case APPLY_ATTBONUS_BELL: case APPLY_ATTBONUS_FAN: case APPLY_ATTBONUS_BOW: #endif in char.h find: POINT_RESIST_PENETRATE = 137, add bellow: #ifdef ENABLE_BONUS_STRONG_AGAINST_WEAPON POINT_ATTBONUS_SWORD = 138, POINT_ATTBONUS_TWOHANDED = 139, POINT_ATTBONUS_DAGGER = 140, POINT_ATTBONUS_BELL = 141, POINT_ATTBONUS_FAN = 142, POINT_ATTBONUS_BOW = 143, #endif in cmd_general.cpp find: case POINT_RESIST_SHAMAN: return LC_TEXT("ą«´ç°ř°Ýżˇ %d%% ŔúÇ×"); add bellow: #ifdef ENABLE_BONUS_STRONG_AGAINST_WEAPON case POINT_ATTBONUS_SWORD: return LC_TEXT("Sword resistance: %d%%"); case POINT_ATTBONUS_TWOHANDED: return LC_TEXT("Two Hand resistance: %d%%"); case POINT_ATTBONUS_DAGGER: return LC_TEXT("Dagger resistance: %d%%"); case POINT_ATTBONUS_BELL: return LC_TEXT("Bell resistance: %d%%"); case POINT_ATTBONUS_FAN: return LC_TEXT("Fan resistance: %d%%"); case POINT_ATTBONUS_BOW: return LC_TEXT("Bow resistance: %d%%"); #endif in constants.cpp find: { POINT_RESIST_PENETRATE, }, // APPLY_ANTI_PENETRATE_PCT, 91 add bellow: #ifdef ENABLE_BONUS_STRONG_AGAINST_WEAPON { POINT_ATTBONUS_SWORD, }, { POINT_ATTBONUS_TWOHANDED, }, { POINT_ATTBONUS_DAGGER, }, { POINT_ATTBONUS_BELL, }, { POINT_ATTBONUS_FAN, }, { POINT_ATTBONUS_BOW, }, #endif find: { "MELEE_MAGIC_ATTBONUS_PER", APPLY_MELEE_MAGIC_ATTBONUS_PER }, add bellow: #ifdef ENABLE_BONUS_STRONG_AGAINST_WEAPON { "ATT_BONUS_TO_SWORD", APPLY_ATTBONUS_SWORD }, { "ATT_BONUS_TO_TWOHAND", APPLY_ATTBONUS_TWOHANDED }, { "ATT_BONUS_TO_DAGGER", APPLY_ATTBONUS_DAGGER }, { "ATT_BONUS_TO_BELL", APPLY_ATTBONUS_BELL }, { "ATT_BONUS_TO_FAN", APPLY_ATTBONUS_FAN }, { "ATT_BONUS_TO_BOW", APPLY_ATTBONUS_BOW }, #endif let's go into client source side: open Locale_inc.h and add where you want: #define ENABLE_BONUS_STRONG_AGAINST_WEAPON open packet.h and find: POINT_RESIST_PENETRATE = 137, add bellow: #ifdef ENABLE_BONUS_STRONG_AGAINST_WEAPON POINT_ATTBONUS_SWORD = 138, POINT_ATTBONUS_TWOHANDED = 139, POINT_ATTBONUS_DAGGER = 140, POINT_ATTBONUS_BELL = 141, POINT_ATTBONUS_FAN = 142, POINT_ATTBONUS_BOW = 143, #endif open Itemdata.h and find: APPLY_ANTI_PENETRATE_PCT, //91 add bellow: #ifdef ENABLE_BONUS_STRONG_AGAINST_WEAPON APPLY_ATTBONUS_SWORD, // 92 APPLY_ATTBONUS_TWOHANDED, // 93 APPLY_ATTBONUS_DAGGER, // 94 APPLY_ATTBONUS_BELL, // 95 APPLY_ATTBONUS_FAN, // 96 APPLY_ATTBONUS_BOW, // 97 #endif open PythonItemModule.cpp and find: PyModule_AddIntConstant(poModule, "APPLY_ANTI_PENETRATE_PCT", CItemData::APPLY_ANTI_PENETRATE_PCT); add bellow: #ifdef ENABLE_BONUS_STRONG_AGAINST_WEAPON PyModule_AddIntConstant(poModule, "APPLY_ATTBONUS_SWORD", CItemData::APPLY_ATTBONUS_SWORD); PyModule_AddIntConstant(poModule, "APPLY_ATTBONUS_TWOHANDED", CItemData::APPLY_ATTBONUS_TWOHANDED); PyModule_AddIntConstant(poModule, "APPLY_ATTBONUS_DAGGER", CItemData::APPLY_ATTBONUS_DAGGER); PyModule_AddIntConstant(poModule, "APPLY_ATTBONUS_BELL", CItemData::APPLY_ATTBONUS_BELL); PyModule_AddIntConstant(poModule, "APPLY_ATTBONUS_FAN", CItemData::APPLY_ATTBONUS_FAN); PyModule_AddIntConstant(poModule, "APPLY_ATTBONUS_BOW", CItemData::APPLY_ATTBONUS_BOW); #endif let's go into Dump Proto source: open ItemCSVReader.cpp and find(in string arApplyType[]): "APPLY_ANTI_PENETRATE_PCT", add after: "APPLY_ATTBONUS_SWORD","APPLY_ATTBONUS_TWOHANDED","APPLY_ATTBONUS_DAGGER","APPLY_ATTBONUS_BELL","APPLY_ATTBONUS_FAN","APPLY_ATTBONUS_BOW", let's go into Client root/locale part: open uiToolTip.py and find: item.APPLY_ANTI_PENETRATE_PCT : locale.TOOLTIP_ANTI_PENETRATE_PCT, add bellow: item.APPLY_ATTBONUS_SWORD : locale.TOOLTIP_ATTBONUS_SWORD, item.APPLY_ATTBONUS_TWOHANDED : locale.TOOLTIP_ATTBONUS_TWOHANDED, item.APPLY_ATTBONUS_DAGGER : locale.TOOLTIP_ATTBONUS_DAGGER, item.APPLY_ATTBONUS_BELL : locale.TOOLTIP_ATTBONUS_BELL, item.APPLY_ATTBONUS_FAN : locale.TOOLTIP_ATTBONUS_FAN, item.APPLY_ATTBONUS_BOW : locale.TOOLTIP_ATTBONUS_BOW, inside locale folder, open locale_game.txt, add in the end: TOOLTIP_ATTBONUS_SWORD Strong Against Sword +%d%% SA TOOLTIP_ATTBONUS_TWOHANDED Strong Against Two-Handed Weapon +%d%% SA TOOLTIP_ATTBONUS_DAGGER Strong Against Dagger +%d%% SA TOOLTIP_ATTBONUS_BELL Strong Against Bell +%d%% SA TOOLTIP_ATTBONUS_FAN Strong Against Fan +%d%% SA TOOLTIP_ATTBONUS_BOW Strong Against Bow +%d%% SA To use new bonuses please use in you item_proto.txt: APPLY_ATTBONUS_SWORD APPLY_ATTBONUS_TWOHANDED APPLY_ATTBONUS_DAGGER APPLY_ATTBONUS_BELL APPLY_ATTBONUS_FAN APPLY_ATTBONUS_BOW
  4. lua [HELP]Quest Problem

    Hello, I have this problem in this quest. SYSERR: Oct 21 16:30:06 :: HandleEvent: QUEST There's suspended quest state, can't run new quest state (quest: main_quest_lv2_2 pc: Ario) Can somebody help me? quest main_quest_lv2_2 begin state start begin end state run begin when login or levelup or enter with pc.get_level() >= 2 begin set_state ( gotoinfomation ) end end state gotoinfomation begin when letter begin if (pc.get_empire()==2) then local v=find_npc_by_vnum(20355) if (v==0) then else target.vid("__TARGET__", v, "") end elseif pc.get_empire()==1 then local v=find_npc_by_vnum(20355) if (v==0) then else target.vid("__TARGET__", v, "") end elseif pc.get_empire()==3 then local v=find_npc_by_vnum(20355) if (v==0) then else target.vid("__TARGET__", v, "") end end end when __TARGET__.target.click begin target.delete("__TARGET__") say_green("Capitán:") say_white("Hola, ¿quien eres?") say_white("¿No serás un salvaje?, ultimamente han invadido la ciudad.") say_white("") say_gold("Yo:") say_white("No, acabo de llegar a la ciudad, y estoy hablando con") say_white("algunos aldeanos, a sí, el Vendedor de Armaduras me ha.") say_white("dicho que tiene las armaduras terminadas.") say_white("") wait() say_green("Capitán:") say_white("Vale, pues ahora mismo estoy ocupado, ya iré por ellas.") say_white("Bueno pues veo que aun no tienes un arma, ni habilidades.") say_white("ve a visitar a el Vendedor de Armas, el te dará una espada.") say_white("") say_white("Tras eso, dirigete hacia el maestro de habilidades, podrás") say_white("empezar a aprender tus habilidades.") say_white("") pc.give_exp2( 900 ) clear_letter() set_state (__COMPLETE__) set_quest_state("find_squareguard","find") end end state __COMPLETE__ begin end end main_quest_lv2_2.quest
  5. [PyLUA++]Tradehouse

    Hi there Devs, I would like to share my "little" system. If you aren't interested in the introduction/preview etc. and you just want to download it and put in to your server, just scroll down until the "[How-To] Set up" subtitle. The story Firstly let me tell this system's story. I've got an idea one year before, that it would be good if the players would be able to put their items into a "global" system where they could see the other player's items, and they could buy it for DC or gold (that time I worked with the latest vanilla core (not with the source)). Then in the following 8 days I made it (it took about 80-90 working hours). Originally the system was created for one of my friend's server. but this server has never started, and nobody used this system. After some mounts I've decided to publish it on the Hungarian forum, because it won't worth to work on it for long hours if nobody uses it and its just collecting dust on my computer. Then I've published it on the 2nd of December, 2014. After some time I've decided to translate it into English and I've got a new idea for a new feature. This feature was: the trade system (I will explain its working later). This idea inspired by one of the players (from a server where this system was able to use). He told me that it would be better if they could set the gold price via an item (what's value is very high). Then with more than 180 working hours (totally) behind my back I'm here. Overview [How-To] Set up Customizing the tradehouse Questions and Answers Notes changelog: 19th of August, 2015: I publicated the tradehouse here. my toDo list: add logging for the system (the released version don't log the actions in the tradehouse) Thanks for reading the topic, if you have any problem/remark feel free to ask it here or write me a PM. Have a good day!
  6. [File: Src/Game/common/service.h] #define ENABLE_HIDE_NAME_PLAYER [File: Src/Game/common/length.h] //#1.) Search: enum EOnIdleEvents { ON_IDLE_NONE, ON_IDLE_GENERAL, ON_IDLE_MAX_NUM }; //#2.) Add bellow: #ifdef ENABLE_HIDE_NAME_PLAYER enum ETypeEventOX { EVENT_OX_MAP = 113, EVENT_OX_FLAG = 0, }; #endif [File: Src/Game/affect.h] //#1.) Search: AFFECT_BLEND, //#2.) Add bellow: #ifdef ENABLE_HIDE_NAME_PLAYER AFFECT_HIDE_NAME, #endif [File: Src/game/input_login.cpp] //#1.) Search: if (ch->GetHorseLevel() > 0) { DWORD pid = ch->GetPlayerID(); if (pid != 0 && CHorseNameManager::instance().GetHorseName(pid) == NULL) db_clientdesc->DBPacket(HEADER_GD_REQ_HORSE_NAME, 0, &pid, sizeof(DWORD)); ch->SetHorseLevel(ch->GetHorseLevel()); ch->SkillLevelPacket(); } //#2.) Add bellow: // ------------------------------------------------------------------------ // // This function is loaded when you enter in map ox // // You need to activate loaded functions with /e enable_hide_player 1 // // You need to activate command before start event // // ------------------------------------------------------------------------ // #ifdef ENABLE_HIDE_NAME_PLAYER DWORD dwHidePlayer = quest::CQuestManager::instance().GetEventFlag("enable_hide_player"); // e enable_hide_player value (0 - disable / 1 - activate) if (dwHidePlayer > EVENT_OX_FLAG) { if (ch->GetMapIndex() == EVENT_OX_MAP) { if (!ch->FindAffect(AFFECT_HIDE_NAME)) { ch->ChatPacket(CHAT_TYPE_COMMAND, "hide_player_state"); ch->AddAffect(AFFECT_HIDE_NAME, 0, 0, AFF_NONE, 60*60*24*7, 0, true, false); } } } #endif //#1.) Search: if (ch->GetGMLevel() == GM_PLAYER) ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire())); //#2.) Delete and replaced with: // ------------------------------------------------------------------------ // // When event ox is finished and teleport you in your home, name players // // will return back ! // // ------------------------------------------------------------------------ // if (ch->GetGMLevel() == GM_PLAYER) #ifdef ENABLE_HIDE_NAME_PLAYER ch->RemoveAffect(AFFECT_HIDE_NAME); ch->ChatPacket(CHAT_TYPE_COMMAND, "show_player_state"); #endif ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire())); ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [File: Client/root/game.py] //#1.) Search: "ShowMeMallPassword" : self.AskMallPassword, //#2.) Add bellow: "hide_player_state" : self.__Player_HideState, "show_player_state" : self.__Player_ShowState, //#1.) Search: def AskMallPassword(self): self.interface.AskMallPassword() //#2.) Add bellow: def __Player_HideState(self): # Function is loaded when you are start flag enable_hide_player 1 and when you are enter in map ox. import uiGameOption self.szGetVegasModule = uiGameOption.OptionDialog() self.szGetVegasModule.__OnClickAlwaysShowNameOffButton() # Hide player name #self.szGetVegasModule.__OnClickViewChatOffButton() # Hide chat def __Player_ShowState(self): #// Function is loaded when event is finished import uiGameOption self.szGetVegasModule = uiGameOption.OptionDialog() # Show player name self.szGetVegasModule.__OnClickAlwaysShowNameOnButton() #self.szGetVegasModule.__OnClickViewChatOnButton() # Show chat ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Here is loaded function for people have < 40k (no source) quest ox_hide_state begin state start begin when login with pc.get_map_index() == 113 begin if game.get_event_flag("enable_hide_player") > 0 then cmdchat("hide_player_state") end end when logout with pc.get_map_index() == 113 begin if game.get_event_flag("enable_hide_player") > 0 then cmdchat("show_player_state") end end end end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Other thing about block: [File: Client/root/game.py] //#1.) Search: def ShowName(self): self.ShowNameFlag = TRUE self.playerGauge.EnableShowAlways() player.SetQuickPage(self.quickSlotPageIndex+1) //#2.) Delete and replaced with: def ShowName(self): import background if constInfo.ENABLE_HIDE_NAME_PLAYER > 0: if background.GetCurrentMapName() == constInfo.EVENT_OX_MAPNAME: chat.AppendChat(chat.CHAT_TYPE_INFO, constInfo.EVENT_OX_WARNING_ALT) else: self.ShowNameFlag = TRUE self.playerGauge.EnableShowAlways() player.SetQuickPage(self.quickSlotPageIndex+1) [File: Client/root/uiGameOption.py] //#1.) Search: def __OnClickAlwaysShowNameOnButton(self): systemSetting.SetAlwaysShowNameFlag(True) self.RefreshAlwaysShowName() def __OnClickAlwaysShowNameOffButton(self): systemSetting.SetAlwaysShowNameFlag(False) self.RefreshAlwaysShowName() //#2.) Delete and replaced with: def __OnClickAlwaysShowNameOnButton(self): import uiCommon, background if constInfo.ENABLE_HIDE_NAME_PLAYER > 0: if background.GetCurrentMapName() == constInfo.EVENT_OX_MAPNAME: self.wndPopup = uiCommon.PopupDialog() self.wndPopup.SetText(constInfo.EVENT_OX_WARNING_ON) self.wndPopup.Open() else: systemSetting.SetAlwaysShowNameFlag(True) self.RefreshAlwaysShowName() def __OnClickAlwaysShowNameOffButton(self): import uiCommon, background if constInfo.ENABLE_HIDE_NAME_PLAYER > 0: if background.GetCurrentMapName() == constInfo.EVENT_OX_MAPNAME: self.wndPopup = uiCommon.PopupDialog() self.wndPopup.SetText(constInfo.EVENT_OX_WARNING_OFF) self.wndPopup.Open() else: systemSetting.SetAlwaysShowNameFlag(False) self.RefreshAlwaysShowName() [File: Client/root/uiGameOption.py] //#1.) Search: CHRNAME_COLOR_INDEX = 0 //#2.) Add bellow: ################################################## HIDE PLAYER NAME - START ###################################################################### ###################################################################################################################################################### ENABLE_HIDE_NAME_PLAYER = 1 # Enable check [0 - disable / 1 - enabled] EVENT_OX_MAPNAME = "season1/metin2_map_oxevent" # Name map EVENT_OX_WARNING_ALT = "You can not do this during the event!" # Message when you press key [ALT] from keyboard. EVENT_OX_WARNING_ON = "You can display the name of the player during the event ox!" # Message loaded from gameOption when you -> Name Always (Show). EVENT_OX_WARNING_OFF = "You can disable the name of the player during the event ox!" # Message loaded from gameOption when you -> Name Always (Hide). ################################################## HIDE PLAYER NAME - STOP ####################################################################### ###################################################################################################################################################### PS: I not tested, i only write for other friend because he say me to help with this. - http://image.prntscr.com/image/f12be8a99a9647c7a5347d237df31fe4.png
  7. Hello guys, i made a simple function that allows you to easily manage files. This function let you create, read, write, rewrite or erase lines of text or the hole text. Examples on how to use it: Here is the function: Aditional Information: You can put in line "all" , and the function will erase/add/rewrite all lines. You can put in line "-1" and it will count as the last line of the file. Types: "add", "create", "erase", "rewrite" and "read". I hope it will be usefull , Kind Regards, Frozen
×