Beiträge von VegaS

    Google translate german-english isn't so good, but i think that is what you want.

    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([]):


    • How to use self.Realloc(None, []):


    How you can play with GetChildList, another example:



    Python
    1. for (key, object) in enumerate(self.GetChildList(["TextLineA", "TextLineB", "TextLineC"])):
    2. object.SetText("Format line: {0}".format(key))


    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)


    Declare textLine as instance of ui.TextLine() and put the line to SetText on OnUpdate

    Python
    1. from datetime import datetime
    2. self.textLine.SetText(datetime.now().strftime('%H:%M:%S %Y-%m-%d'))
    3. >>> 09:23:27 2017-11-10

    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.


    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 tested

    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.

    Rebuild the source client maybe the ScriptLib isn't was compiled with the last modifications and remaining the old one.
    Some people was had this problem with reading folder what contain uppercase:

    ChildLoop: AsyncSQL: query failed: Unknown column 'part_acce' in 'field list'

    C
    1. //@src/db/ClientManagerPlayer.cpp
    2. //Search for:
    3. "stat_point,skill_point,sub_skill_point,stat_reset_count,part_base,part_hair,part_acce,"
    4. //Replace with:
    5. "stat_point,skill_point,sub_skill_point,stat_reset_count,part_base,part_hair,"

    Already you get the point and how to do it.
    Now all what you have to do is just replace the minus value default with the one what you want for each bonus, there is just some bonus, not 1000.
    Search the value default for each one and do it, like these one:

    CSS
    1. self.GetChild("MSPD_Value").SetText("%d" % (max(0, player.GetStatus(player.MOVING_SPEED) - 100)))
    2. self.GetChild("ASPD_Value").SetText("%d" % (max(0, player.GetStatus(player.ATT_SPEED) - 100)))
    3. self.GetChild("CSPD_Value").SetText("%d" % (max(0, player.GetStatus(player.CASTING_SPEED) - 100)))

    That should be ok i think.

    Python
    1. """
    2. File: src/game/char.cpp
    3. &CHARACTER::ComputePoints()
    4. &SetPoint(POINT_MOV_SPEED, 100) // Default value
    5. &Total amount of movement speed = player.GetStatus(player.MOVING_SPEED).
    6. &Total amount -= STANDARD_SPEED(100) result only accumulated bonuses from equipment.
    7. """
    8. SetText("%d" % (max(0, player.GetStatus(player.MOVING_SPEED) - 100)))



    This script was killed by who did it.
    Please do not kill python, it's a nice language.


    PS: Didn't tested it.

    We don't need to add extra switch when already exist a boolean on instance class of item with these checks, CItem::CanUsedBy (Bitte melden Sie sich an, um diesen Link zu sehen.)


    So in this case just do this:


    C
    1. //Search for:
    2. if (item->CheckItemUseLevel(ch->GetLevel()) == true)
    3. //Replace with:
    4. if (item->CheckItemUseLevel(ch->GetLevel()) && item->CanUsedBy(ch))

    Have careful on tabs too, because you was change variables on out of function OnLogin

    Check here:
    Bitte melden Sie sich an, um diesen Link zu sehen.

    That should be more clean on my opinion.

    Not need a loop to check every value of list because already is list. (I was tired when i do the release with affect potion)
    Should look like that maybe, but is really shit. (not do that)

    Python
    1. if type < 500 and not type in mainAffectPotion["affect"] and type <> chr.NEW_AFFECT_POLYMORPH:

    ______________________________________________________________________________________________________________
    To assigned the list affects exist more methods, use it what you want, this is just a ex. (here we speak about optimize, but in this case when have just some elements, isn't problem what method you used

    Python
    1. self.NEW_AFFECT_LIST = mainAffectPotion["affect"]
    2. self.NEW_AFFECT_LIST = mainAffectPotion["affect"][:]
    3. self.NEW_AFFECT_LIST = mainAffectPotion["affect"] * 1
    4. self.NEW_AFFECT_LIST = list(mainAffectPotion["affect"])
    5. self.NEW_AFFECT_LIST = copy.deepcopy(mainAffectPotion["affect"])
    6. self.NEW_AFFECT_LIST = eval(repr(mainAffectPotion["affect"]))
    7. self.NEW_AFFECT_LIST = [i for i in mainAffectPotion["affect"]]
    8. self.NEW_AFFECT_LIST.extend(mainAffectPotion["affect"])

    Do it like that:


    Zitat von Quadra1

    now the trigger work fine, but the column coins wont get updated in account.account


    Already ymir did the function for lua to charge the coins via pc.charge_cash, but not all people was used because name of row is called: "cash" and they are used on website/itemshop etc row "coins", but can change very easy.
    You don't need to use other mysql query command for that, when you already have that on source.
    Go in /src/db/ClientManager.cpp
    Search for:

    C
    1. sprintf(szQuery, "update account set `cash` = `cash` + %d where id = %d limit 1", packet->dwAmount, packet->dwAID);

    Replace `cash` = `cash` with `coins` = `coins`.