Bitte melden Sie sich an, um dieses Bild zu sehen.
Beiträge von VegaS
-
-
I didn't test it, but you can do some tricks for that.
With what i made here you can delete the file ../root/introEmpire.py, will no longer be used.
________________________________________________________________- ../root/networkmodule.py
Search for:
Python- def SetSelectEmpirePhase(self):
- try:
- import introEmpire
- self.SetPhaseWindow(introEmpire.SelectEmpireWindow(self))
- except:
- import exception
- exception.Abort("networkModule.SetSelectEmpirePhase")
- def SetReselectEmpirePhase(self):
- try:
- import introEmpire
- self.SetPhaseWindow(introEmpire.ReselectEmpireWindow(self))
- except:
- import exception
- exception.Abort("networkModule.SetReselectEmpirePhase")
Replace it with:
Python- def SetSelectEmpirePhaseAuto(self, baseCreatePhase, baseDefaultEmpire = net.EMPIRE_A):
- net.SendSelectEmpirePacket(baseDefaultEmpire) #eg. net.EMPIRE_A | net.EMPIRE_B | net.EMPIRE_C
- import operator
- operator.getitem([lambda : self.SetSelectCharacterPhase(), lambda : self.SetCreateCharacterPhase()], baseCreatePhase)()
- def SetSelectEmpirePhase(self):
- self.SetSelectEmpirePhaseAuto(False)
- def SetReselectEmpirePhase(self):
- self.SetSelectEmpirePhaseAuto(True)
After that, do it on source this change aswell.
CSS- //@src/Server/db/src/ClientManager.cpp
- //Search for:
- snprintf(szQuery, sizeof(szQuery), "UPDATE player_index%s SET empire=%u WHERE id=%u", GetTablePostfix(), p->bEmpire, p->dwAccountID);
- //Replace with:
- enum {EMPIRE_NONE, EMPIRE_A, EMPIRE_B, EMPIRE_C};
- static const uint8_t bDefaultEmpire = EMPIRE_A;
- snprintf(szQuery, sizeof(szQuery), "UPDATE player_index%s SET empire=%u WHERE id=%u", GetTablePostfix(), (p->bEmpire == bDefaultEmpire) ? p->bEmpire : bDefaultEmpire, p->dwAccountID);
-
Welcome to 2009, amazing skills on Lua.
-
Bitte melden Sie sich an, um dieses Bild zu sehen.
Replace player_msg with messages. (name of begin quest)
-
Try that.
Python- #@../root/interfaceModule.py
- #1.) Search for:
- self.listGMName = {}
- #1.) Add after:
- import uiswitchbot
- self.wndSwitchBot = uiswitchbot.Bot()
- self.wndSwitchBot.Hide()
- #2.) Search for:
- del self.wndMessenger
- #2.) Add after:
- if self.wndSwitchBot:
- del self.wndSwitchBot
- #3.) Search for:
- if self.wndTaskBar:
- self.wndTaskBar.Hide()
- #3.) Add after:
- if self.wndSwitchBot:
- self.wndSwitchBot.Hide()
- #4.) Search for:
- if self.wndEnergyBar:
- hideWindows += self.wndEnergyBar,
- #4.) Add after:
- if self.wndSwitchBot:
- hideWindows += self.wndSwitchBot,
- #@../root/uiInventory.py - How to call:
- def ClickSwitchboot(self):
- [self.interface.wndSwitchBot.Show(), self.interface.wndSwitchBot.Hide()][self.interface.wndSwitchBot.IsShow()]
-
First one thanks for release, i'm not good on Lua but i can give some advices on this case.
- These checks don't need to exist.
- Is enough just to check if selectIndex is equal with last element from arbitrary positions of a list.
- I don't recommended you to use the metatables of pc_functions, instead of pc.job use pc.get_job is more safe and doesn't have sense to use it a metatable on this case.
CSS- function GetSkillGroupList()
- local job = pc.job
- local skill_group_list = {}
- if job == 0 then
- table.insert(skill_group_list, "Körperkampf-Lehre")
- table.insert(skill_group_list, "Mentalkampf-Lehre")
- elseif job == 1 then
- table.insert(skill_group_list, "Nahkampf-Lehre")
- table.insert(skill_group_list, "Fernkampf-Lehre")
- elseif job == 2 then
- table.insert(skill_group_list, "Magische Waffen-Lehre")
- table.insert(skill_group_list, "Schwarze Magie-Lehre")
- elseif job == 3 then
- table.insert(skill_group_list, "Lehre der Drachenmacht")
- table.insert(skill_group_list, "Lehre der Heilung")
- elseif job == 4 then
- table.insert(skill_group_list, "Instinkt")
- end
- table.insert(skill_group_list, "Abbrechen")
- return skill_group_list
- end
- Instead of do a check for each race and insert the group name you can do a simple table wich you can retrieve the name of each race.
Shell-Script- function GetSkillGroupList()
- local skill_group_name = {
- [WARRIOR] = {"Körperkampf-Lehre", "Mentalkampf-Lehre"},
- [ASSASSIN] = {"Nahkampf-Lehre", "Fernkampf-Lehre"},
- [SURA] = {"Magische Waffen-Lehre", "Schwarze Magie-Lehre"},
- [SHAMAN] = {"Lehre der Drachenmacht", "Lehre der Heilung"},
- [WOLFMAN] = {"Instinkt"}
- }
- local skill_group_list = skill_group_name[pc.get_job()]
- table.insert(skill_group_list, "Abbrechen")
- return skill_group_list
- end
-
Python
- """
- How To Use Ex:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- @E.g #1:
- class ZodiacTempleToolTipBoard(ui.ThinBoard):
- CONFIG = ui.RegisterStructClass('TOOLTIP_BASE_POS TOOLTIP_WIDTH TOOLTIP_HEIGHT TOOLTIP_DEFAULT_SIZE_DICT '
- 'TOOLTIP_TOP_RANK_LIST TOOLTIP_ADD_STRING')(100, 450, 300, {'w': 400, 'h': 500}, [1, 2, 3], 'String')
- def __mem_func__(self):
- print (self.CONFIG.TOOLTIP_BASE_POS, self.CONFIG.TOOLTIP_WIDTH, self.CONFIG.TOOLTIP_HEIGHT, self.CONFIG.TOOLTIP_ADD_STRING)
- print (self.CONFIG.TOOLTIP_DEFAULT_SIZE_DICT.get('w'), self.CONFIG.TOOLTIP_DEFAULT_SIZE_DICT.get('h'))
- print self.CONFIG.TOOLTIP_TOP_RANK_LIST
- @E.g #2:
- self.Transfer(ui.RegisterStructClass('szName lX lY')(player.GetName(), player.GetX(), player.GetY())) # TPacketGGTransfer
- def Transfer(self, c_pData):
- print(c_pData.szName, c_pData.lX, c_pData.lY)
- @E.g #3:
- pack = ui.RegisterStructClass('a b c')(15, {}, [])
- pack.a += 50
- pack.b.update({0: 250})
- pack.c.append(100)
- print (pack.a, pack.b, pack.c)
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- """
Have fun.
Attachment code: -
FTP LIB:
- Bitte melden Sie sich an, um diesen Link zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.
-
Bitte melden Sie sich an, um dieses Bild zu sehen.
Have fun.
Download link: -
Class Render Monster Card
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~- A simple Python Module which gives you the chance to be able to turn mob differently with a specific animation such as atack, motion, death etc.
- This module was not designed for beginners in python, this is just a beginning for the rendering of every monster.
- You can also use it for other systems for render.
WARNING:
- I don't offer any support for this, that module is just for guys who know what have to do.
- Code isn't working like official one.
- This script has not been tested, is just a simple idea like better then 'pseudocode', you need to improve and do compatible with your scripts.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
Zitat
Probably changing the way it indexes the data does the deal, using strings instead of numbers sounds good to me.
Now you can use it more easy, have fun.
Python- #root/ui.py
- def GetChildDictionary(self, received_objects):
- if (isinstance(received_objects, (list, tuple))):
- return {item : self.ElementDictionary.get(item, None) for item in received_objects}
- return dict()
- def Realloc(self, state, received_objects, allowed_type = [self.STATE_HIDE, self.STATE_SHOW]):
- if (not state in allowed_type or not isinstance(received_objects, dict)):
- import dbg
- dbg.TraceError(
- "<ScriptWindow> Failed to change state.\n{0}\n{1}".format(
- "<state '{0}'> Allowed states: {1}.".format(state, allowed_type),
- "{0} Allowed type: {1}.".format(type(received_objects), type(dict()))))
- return
- [item.Hide() if (state is self.STATE_HIDE) else item.Show()
- for item in [zip for zip in received_objects.values() if (zip is not None)]]
- #main.py (How to use - Example):
- self.childrenDict = self.GetChildDictionary(["LoginButton", "LoginExitButton"])
- self.childrenDict["LoginButton"].SetPosition(20, 500)
- self.childrenDict["LoginExitButton"].SetPosition(-300, 800)
- self.Realloc(self.STATE_SHOW, childrenDict) # Use Realloc(state, object_dictionary) for a action as Hide() or Show() by state.
-
Mal so ne blöde Frage, wo holt er sich denn die Skills her? Also die Namen, Segen usw.?
It's just a 'debug' <test_server> for show the skill name and power skill % received/actual, you can delete the chat line.
player.skill_proto.sql.szNamesmall but fine
Some small stuff like this can impress your players.
-
Bitte melden Sie sich an, um dieses Medienelement zu sehen.
Bitte melden Sie sich an, um dieses Bild zu sehen.
-
Google translate german-english isn't so good, but i think that is what you want.
CSS- //@src/game/char_item.cpp
- //Delete:
- // Except for arrows, equipment can be changed after the last attack time or skill use 1.5.
- DWORD dwCurTime = get_dword_time();
- if (iWearCell != WEAR_ARROW
- && (dwCurTime - GetLastAttackTime() <= 1500 || dwCurTime - m_dwLastSkillTime <= 1500))
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("가만히 있을 때만 착용할 수 있습니다."));
- return false;
- }
-
This module was not designed for people who don't know nothing about python.
Here is a simple functions which gives you the chance to be able to turn all objects of script loader (uiScript) into a a simple list and control all very simple.
This is more easy if you have a lot a objects and want to do some actions with them like set multiples text, load images etc. do a simple loop by range start:end and you can play with it.- self.OBJECT_MAX_NUM = 25 | You can change how many max objects you can send into list.
- self.Realloc(state, objectList) | You can run a action (Hide() / Show()) for all objects what you sended on list.
How to use GetChildList([]):
Python- class TestWindow(ui.ScriptWindow):
- def __init__(self):
- ui.ScriptWindow.__init__(self)
- ui.PythonScriptLoader().LoadScriptFile(self, "uiscript/guildwindow.py")
- self.childrenList = self.GetChildList(["GuildNameValue", "DeclareWarButton", "Board"])
- def Reference(self):
- self.childrenList[0].SetText("GUARDIANS")
- self.childrenList[1].SetPosition(100, 200)
- self.childrenList[2].SetSize(500, 1000)
- How to use self.Realloc(None, []):
How you can play with GetChildList, another example:
Code (Is a little shit, i was write on some minutes for test something, so i was think it's ok if i share with you because i don't use) -
-
Bitte melden Sie sich an, um dieses Medienelement zu sehen.
-
dont work, you understand this?
I'm not your brother or your employee, stop to reactionate like this, you don't pay me to do your full job 100%.
You didn't gave full informations and you not paste the full quest and you didn't explain what exactly you want, no one is bound to help you, like this style.
"don't work, you understand this?"
Do you know what exactly that means? it looks like you're a shit kid what want to receive all d**** in him mouth, stop to be angry, you don't solve nothing.How it's working this:
When you click on NPC he check your actual map index and return the table of this:- Argument 1: Level - Key from loop, 1|2|3.
- Argument 2: Index where you need to join 107|108|109
- Argument 3: Name of map
If you are in mapIndex 5 you will get table of index 1 (Join on index level(1), joinIndex(107), name(leichte farmamp)
I didn't test this quest but i'm sure is working well, my domain isn't Lua, i just was trying to help you, but i see your comment and character is by far the worst of all I've ever seen.Perl- quest Gemi begin
- state start begin
- function GetData()
- local recv = {
- [1] = { 5, 107, "Leichte Farmmap" },
- [2] = { 25, 108, "Mittlere Farmmap" },
- [3] = { 45, 109, "Schwere Farmmap" }
- }
- for key, tbl in pairs(recv) do
- if (pc.get_map_index() == tbl[1]) then
- return key, tbl[2], tbl[3]
- end
- end
- return 0
- end
- when 9003.chat."Test Index" begin
- local level, index, name = Gemi.GetData()
- if (level > 0) then
- say(name)
- pc.setqf("level", level)
- d.regen_file(string.format("data/dungeon/monkey/monkey%d.txt", level))
- d.join(index)
- end
- end
- end
- end
-
keiner eine idee?
I didn't understand very well what exactly you want because you didn't post the function determine_index, but maybe something like this
I didn't testedPerl- quest monkeyDungeon begin
- state start begin
- function GetData()
- local recv = {
- [1] = { 107, "Leichtes Affendungeon" }, -- Index 1
- [2] = { 108, "Mittleres Affendungeon" }, -- Index 2
- [3] = { 109, "Schweres Affendungeon" } -- Index 3
- }
- for key, tbl in pairs(recv) do
- if (pc.get_map_index() == tbl[1]) then
- return key, tbl[1], tbl[2]
- end
- end
- return 0 -- Enough to return just the argument of level as 'nil'.
- end
- when 9003.chat."Test Index" begin
- local level, index, name = monkeyDungeon.GetData()
- if (level > 0) then
- say(name)
- pc.setqf("level", level)
- d.regen_file(string.format("data/dungeon/monkey/monkey%d.txt", level))
- d.join(index)
- end
- end
- end
- end
-
No, not exist a 'better' solution and more 'elegant'.
Ymir was did a lot a things like that, not all is 'extensible' for change, is a real value of bonus default what is seted and is calculated with all bonuses, so you can't remove to show on python only the amount of equipment without do a check on c++ or python and check each bonus and result the "if type == bonus -> amount -= kBonusDefaultInfo[type]".
This is the only solution and I do not think I'm mistaken.