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.


Found 3 results

  1. 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!
  2. [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
  3. 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